Function SharedPtr.length

Returns length of dynamic array (isDynamicArray!ElementType == true).

size_t length() const pure nothrow @nogc @property scope @safe;

Examples

auto x = SharedPtr!(int[]).make(10, -1);
assert(x.length == 10);
assert(x.get.length == 10);

import std.algorithm : all;
assert(x.get.all!(i => i == -1));