tanya.range.primitive

This module defines primitives for working with ranges.

Members

Functions

getAndPopBack
auto ref getAndPopBack(R range)

Returns the last element and removes it from the range.

getAndPopFront
ElementType!R getAndPopFront(R range)

Returns the first element and advances the range.

moveAt
ElementType!R moveAt(R range, size_t n)

Moves the element at the position n out of the range.

moveBack
ElementType!R moveBack(R range)

Moves the back element of a bidirectional range.

moveFront
ElementType!R moveFront(R range)

Moves the front element of an input range.

popBackExactly
void popBackExactly(R range, size_t count)

Removes exactly count last elements from the bidirectional range range.

popBackN
void popBackN(R range, size_t count)

Removes maximum count last elements from the bidirectional range range.

popFrontExactly
void popFrontExactly(R range, size_t count)

Removes exactly count first elements from the input range range.

popFrontN
void popFrontN(R range, size_t count)

Removes maximum count first elements from the input range range.

put
void put(R range, E e)

Puts e into the range.

sameHead
bool sameHead(Range r1, Range r2)

Determines whether r1.front and r2.front point to the same element.

Templates

ElementType
template ElementType(R)

Returns the element type of the range R.

hasAssignableElements
template hasAssignableElements(R)

Determines whether the elements of R are assignable.

hasLvalueElements
template hasLvalueElements(R)

Determines whether R provides access to its elements by reference.

hasMobileElements
template hasMobileElements(R)

Determines whether $(D_PSYMBOL R) is a range containing mobile elements, i.e. elements that can be moved out of the range.

hasSlicing
template hasSlicing(R)

Determines whether R is a forward range with slicing support (R[i .. j]).

hasSwappableElements
template hasSwappableElements(R)

Determines whether the elements of $(D_PSYMBOL R) can be swapped with $(D_PSYMBOL swap).

isBidirectionalRange
template isBidirectionalRange(R)

Determines whether R is a bidirectional range.

isForwardRange
template isForwardRange(R)

Determines whether R is a forward range.

isInfinite
template isInfinite(R)

Determines whether R is an infinite range.

isInputRange
template isInputRange(R)

Determines whether R is an input range.

isOutputRange
template isOutputRange(R, E)

Determines whether R is an output range for the elemens of type E.

isRandomAccessRange
template isRandomAccessRange(R)

Determines whether R is a random-access range.

Variables

hasLength
enum bool hasLength(R);

Detects whether R has a length property.

Meta