Enum member isRefInputRange
Returns true
if R
is a pseudo input range with ref return.
enum isRefInputRange(R)
= true;
An input range must
define the primitives empty
, popFront
, and front
. The
following code should compile for any input range.
R r; // can define a range object
if (r .empty) {} // can test for empty
r .popFront(); // can invoke popFront()
auto h = r .front; // can get the front of the range of non-void type
The last line fails if the underlying type is non-copyable. It is still possible
to define a pseudo input range that works with non-copyable types by having r
return a reference, but isInputRange
will return false
for it.
Parameters
Name | Description |
---|---|
R | type to be tested |
Returns
true if R is a pseudo InputRange with ref front, false if not