isForwardRange

Determines whether R is a forward range.

A forward range is an input range that also defines:

  • save

Members

Variables

isForwardRange
enum bool isForwardRange;
Undocumented in source.
isForwardRange
enum bool isForwardRange;
Undocumented in source.

Parameters

R

The type to be tested.

Return Value

$(D_KEYWORD true) if R is a forward 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;
    }

    typeof(this) save() @nogc nothrow pure @safe
    {
        return this;
    }
}
static assert(isForwardRange!Range);
static assert(isForwardRange!(int[]));
static assert(!isForwardRange!(void[]));

See Also

$(D_PSYMBOL isInputRange).

Meta