Function moveBack

Moves the back element of a bidirectional range.

ElementType!R moveBack(R) (
  R range
)
if (isBidirectionalRange!R);

The back element is left in a valid but unspecified state. moveBack doesn't advances the range, so popBack should be probably called after this function.

Parameters

NameDescription
R Type of the range.
range Bidirectional range.

Returns

The back element of the range.

See Also

move.

Example

// Has elements without a postblit constructor.
int[2] a = 5;

assert(moveBack(a[]) == 5);