backOr

Retrieves the back of a range or a default value

backOr
(
Range
T
)
(
Range range
,
)
if (
from!"std.range".isBidirectionalRange!Range &&
is(T : from!"std.range".ElementType!Range)
)

Examples

assert((int[]).init.backOr(7) == 7);
assert([1, 2].backOr(3) == 2);

Meta

Since

- 0.0.1