Inner.IndexMixin

Sequenced index implementation

Requirements: the following symbols must be defined in the scope in which this index is mixed in:

ThisNode, Value, __InsertAllBut!N, __InsertAll, __Replace, __RemoveAllBut!N, node_count

Members

Aliases

insert
alias insert = insertBack

Forwards to insertBack

removeAny
alias removeAny = removeBack

Forwards to removeBack

Functions

insertBack
size_t insertBack(SomeRange stuff)

Inserts every element of stuff not rejected by another index into the back of the index.

insertBack
size_t insertBack(SomeValue value)

Inserts value into the back of the sequence, if no other index rejects value

insertFront
size_t insertFront(SomeRange stuff)

Inserts every element of stuff not rejected by another index into the front of the index.

insertFront
size_t insertFront(SomeValue value)

Inserts value into the front of the sequence, if no other index rejects value

opSlice
SeqRange opSlice()

Fetch a range that spans all the elements in the container.

relocateBack
void relocateBack(ref PosRange moveme, PosRange tohere)

Moves moveme.back to the position after tohere.back and dec both ranges. Probably not safe to use either range afterwards, but who knows. Preconditions: moveme and tohere are both ranges of the same container Postconditions: moveme.back is decremented Complexity: O(1)

relocateFront
void relocateFront(ref PosRange moveme, PosRange tohere)

Moves moveme.front to the position before tohere.front and inc both ranges. Probably not safe to use either range afterwards, but who knows. Preconditions: moveme and tohere are both ranges of the same container. Postconditions: moveme.front is incremented Complexity: O(1)

remove
SeqRange remove(R r)

Removes the values of r from the container. Preconditions: r came from this index Complexity: O(n r * d(n)),
O(n r) for this index

removeBack
void removeBack()

Removes the value at the back of the index from the container. Precondition: !empty Complexity: O(d(n));
O(1) for this index

removeFront
void removeFront()

Removes the value at the front of the index from the container. Precondition: !empty Complexity: O(d(n)); O(1) for this index

replace
bool replace(Position!ThisNode r, Value value)

Replaces r.front with value

Properties

back
back [@property getter]

Complexity: O(1)

back
Value back [@property setter]

Complexity: O(r(n))

empty
bool empty [@property getter]

Property returning true if and only if the container has no elements.

front
front [@property getter]

Complexity: O(1)

front
Value front [@property setter]

Complexity: O(r(n));
O(1) for this index

length
size_t length [@property getter]

Returns the number of elements in the container.

Meta