isInputRange

Determines whether R is an input range.

An input range should define following primitives:

  • front
  • empty
  • popFront

Members

Variables

isInputRange
enum bool isInputRange;
Undocumented in source.
isInputRange
enum bool isInputRange;
Undocumented in source.

Parameters

R

The type to be tested.

Return Value

$(D_KEYWORD true) if R is an input range, $(D_KEYWORD false) otherwise.

Examples

static struct Range
{
    void popFront() @nogc nothrow pure @safe
    {
    }

    int front() @nogc nothrow pure @safe
    {
        return 0;
    }

    bool empty() const @nogc nothrow pure @safe
    {
        return true;
    }
}
static assert(isInputRange!Range);
static assert(isInputRange!(int[]));
static assert(!isInputRange!(void[]));

Meta