Inner.IndexMixin

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

ConstRARange
alias ConstRARange = RARangeT!true
Undocumented in source.
RARange
alias RARange = RARangeT!false
Undocumented in source.
insert
alias insert = insertBack

inserts elements of r in the back of this index. Complexity: O(n r * i(n)),
amortized O(n r) for this index

removeAny
alias removeAny = removeBack
Undocumented in source.

Functions

_Check
void _Check()
Undocumented in source. Be warned that the author may not have intended to support it.
_ClearIndex
void _ClearIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
_Insert
void _Insert(ThisNode* node)
Undocumented in source. Be warned that the author may not have intended to support it.
_NodeReplace
void _NodeReplace(ThisNode* old, ThisNode* newnode)
Undocumented in source. Be warned that the author may not have intended to support it.
_Remove
void _Remove(ThisNode* n)
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()

_

insertBack
size_t insertBack(SomeValue value)

inserts value in the back of this index. Complexity: O(i(n)),
amortized O(1) for this index

insertBack
size_t insertBack(SomeRange r)

inserts elements of r in the back of this index. Complexity: O(n r * i(n)),
amortized O(n r) for this index

modify
void modify(SomeRange r, Modifier mod)

Perform mod on r.front and performs any necessary fixups to container's indices. If the result of mod violates any index' invariant, r.front is removed from the container. Preconditions: !r.empty,
mod is a callable of the form void mod(ref Value) Complexity: O(m(n)),
O(1) for this index

opIndex
auto opIndex(size_t i)

Preconditions: i < length Complexity: O(1)

opIndexAssign
ValueView opIndexAssign(ValueView value, size_t i)

Sets index i to value, unless another index refuses value Preconditions: i < length

opSlice
RARange opSlice()

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

opSlice
ConstRARange opSlice()
Undocumented in source. Be warned that the author may not have intended to support it.
opSlice
RARange opSlice(size_t a, size_t b)

Fetch a range that spans all the elements in the container from index a (inclusive) to index b (exclusive). Preconditions: a <= b && b <= length

opSlice
ConstRARange opSlice(size_t a, size_t b)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
RARange remove(Range r)

removes elements of r from this container. Complexity: O(n r * d(n)),
O(n) for this index

removeBack
void removeBack()

Removes the last element from this index. Preconditions: !empty Complexity: O(d(n));
O(1) for this index

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

Replaces r.front with value

reserve
void reserve(size_t count)

Ensures sufficient capacity to accommodate count elements.

swapAt
void swapAt(size_t i, size_t j)

Swaps element at index i with element at index j. Preconditions: i < length && j < length Complexity: O(1)

toString0
string toString0()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

back
back [@property getter]

Complexity: O(1)

back
ValueView back [@property setter]

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

capacity
size_t capacity [@property getter]

Returns the capacity of the index, which is the length of the underlying store

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
ValueView 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.

Static functions

_RemovePred
bool _RemovePred(Position!ThisNode a, Position!ThisNode b)
Undocumented in source. Be warned that the author may not have intended to support it.
_RemoveUn
size_t _RemoveUn(Position!ThisNode a)
Undocumented in source. Be warned that the author may not have intended to support it.
_RemoveUn2
size_t _RemoveUn2(ThisNode* a)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

RARangeT
struct RARangeT(bool is_const)

Defines the index' primary range, which embodies a random access range

Templates

IsMyRange
template IsMyRange(T)
Undocumented in source.

Variables

ra
ThisNode*[] ra;
Undocumented in source.

Meta