Name
Range Concept — Requirements for a type representing a recursively divisible set of values. Table 3-2 lists the requirements for a Range type R.
Description
Table 3-2. Range Concept
|
Pseudosignature |
Semantics |
|---|---|
|
|
Copy constructor |
|
|
Destructor |
|
|
|
|
|
|
|
|
Split |
Description
A Range can be recursively subdivided into two parts. It is recommended that the division be into nearly equal parts, but it is not required. Splitting as evenly as possible typically yields the best parallelism. Ideally, a range is recursively splittable until the parts represent portions of work that are more efficient to execute serially rather than split further. This key limit to splitting is called the grain size. The amount of work represented by a Range typically depends upon higher-level context; hence, a typical type that models a Range should provide a way to control the degree of splitting. For example, the template class blocked_ range has a grainsize parameter that specifies the biggest range considered indivisible.
The constructor that implements splitting is called a splitting constructor. If the set of values has a sense of direction, by convention the splitting constructor should construct the second part of the range and update the argument to refer to the first part of the range. Following this convention ...