concepts.range

Better versions of Phobos's template contraints that emit error messages when they fail Can be used with concepts.models.models

Members

Enums

isBidirectionalRange
eponymoustemplate isBidirectionalRange(R)

Returns true if R is a bidirectional range. A bidirectional range is a forward range that also offers the primitives back and popBack. The following code should compile for any bidirectional range.

isForwardRange
eponymoustemplate isForwardRange(R)

Returns true if R is a forward range. A forward range is an input range r that can save "checkpoints" by saving r.save to another value of type R. Notable examples of input ranges that are not forward ranges are file/socket ranges; copying such a range will not save the position in the stream, and they most likely reuse an internal buffer as the entire stream does not sit in memory. Subsequently, advancing either the original or the copy will advance the stream, so the copies are not independent.

isInputRange
eponymoustemplate isInputRange(R)

Returns true if R is an input range. An input range must define the primitives empty, popFront, and front. The following code should compile for any input range.

isOutputRange
eponymoustemplate isOutputRange(R, E)

Returns true if R is an output range for elements of type E. An output range is defined functionally as a range that supports the operation put(r, e) as defined above.

isRandomAccessRange
eponymoustemplate isRandomAccessRange(R)

Returns true if R is a random-access range. A random-access range is a bidirectional range that also offers the primitive opIndex, OR an infinite forward range that offers opIndex. In either case, the range must either offer length or be infinite. The following code should compile for any random-access range.

Functions

checkBidirectionalRange
void checkBidirectionalRange(int )
Undocumented in source. Be warned that the author may not have intended to support it.
checkForwardRange
void checkForwardRange(int )
Undocumented in source. Be warned that the author may not have intended to support it.
checkInputRange
void checkInputRange(int )
Undocumented in source. Be warned that the author may not have intended to support it.
checkOutputRange
void checkOutputRange(int )
Undocumented in source. Be warned that the author may not have intended to support it.
checkRandomAccessRange
void checkRandomAccessRange(int )
Undocumented in source. Be warned that the author may not have intended to support it.

Meta