SList.isUnique

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

struct SList(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 sl = SList!int(24, 42);
assert(sl.isUnique);
{
    auto sl2 = sl;
    assert(!sl.isUnique);
    sl2.front = 0;
    assert(sl.front == 0);
} // sl2 goes out of scope
assert(sl.isUnique);

Meta