save

Returns a copy of the slice array.

$(D_PSYMBOL save) doesn't copy the array itself, but only the data pointer and the length.

@property
inout(T)[]
save
(
T
)
(
return scope inout(T)[] array
)

Parameters

T

Element type of array.

array inout(T)[]

Built-in array.

Return Value

Type: inout(T)[]

A copy of the slice array.

Examples

ubyte[8] array;
auto slice = array.save;

assert(slice.length == array.length);
slice.popFront();
assert(slice.length < array.length);

Meta