hasAssignableElements

Determines whether the elements of R are assignable.

Members

Variables

assignable
enum bool assignable;
Undocumented in source.
assignable
enum bool assignable;
Undocumented in source.
assignable
enum bool assignable;
Undocumented in source.
hasAssignableElements
enum bool hasAssignableElements;
Undocumented in source.

Parameters

R

Range type.

Return Value

$(D_KEYWORD true) if the elements of R are assignable $(D_KEYWORD false) otherwise.

Examples

static struct R1
{
    int element;
    enum bool empty = false;

    ref int front() @nogc nothrow pure @safe
    {
        return element;
    }
    alias back = front;

    void popFront() @nogc nothrow pure @safe
    {
    }
    alias popBack = popFront;

    R1 save() const @nogc nothrow pure @safe
    {
        return this;
    }
}
static assert(hasAssignableElements!R1);

static struct R2
{
    int element;
    enum bool empty = false;

    ref const(int) front() const @nogc nothrow pure @safe
    {
        return element;
    }
    alias back = front;

    void popFront() @nogc nothrow pure @safe
    {
    }
    alias popBack = popFront;

    R2 save() const @nogc nothrow pure @safe
    {
        return this;
    }
}
static assert(!hasAssignableElements!R2);

Meta