isInfinite

Determines whether R is an infinite range.

An infinite range is an input range whose empty member is defined as $(D_KEYWORD enum) which is always $(D_KEYWORD false).

Members

Variables

isInfinite
enum bool isInfinite;
Undocumented in source.
isInfinite
enum bool isInfinite;
Undocumented in source.

Parameters

R

A type.

Return Value

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

Examples

static assert(!isInfinite!int);

static struct NotRange
{
    enum bool empty = false;
}
static assert(!isInfinite!NotRange);

static struct InfiniteRange
{
    void popFront() @nogc nothrow pure @safe
    {
    }
    @property int front() @nogc nothrow pure @safe
    {
        return 0;
    }
    enum bool empty = false;
}
static assert(isInfinite!InfiniteRange);

static struct InputRange
{
    void popFront() @nogc nothrow pure @safe
    {
    }
    @property int front() @nogc nothrow pure @safe
    {
        return 0;
    }
    @property bool empty() const @nogc nothrow pure @safe
    {
        return false;
    }
}
static assert(!isInfinite!InputRange);

Meta