DList.isUnique

Check whether there are no more references to this list instance.

struct DList(T)
const
bool
isUnique
()

Return Value

Type: bool

true if this is the only reference to this list instance; false otherwise.

Complexity: O(n).

Examples

auto dl = DList!int(24, 42);
assert(dl.isUnique);
{
    auto dl2 = dl;
    assert(!dl.isUnique);
    dl2.front = 0;
    assert(dl.front == 0);
} // dl2 goes out of scope
assert(dl.isUnique);

Meta