|
| Array () |
| Constructs an empty Array. More...
|
|
| Array (std::initializer_list< T > list) |
|
| Array (const Array &other) |
|
| Array (Array &&other) |
|
Array & | operator= (const Array &other) |
|
Array & | operator= (Array &&other) |
|
template<int M> |
| Array (const Array< T, M > &other) |
|
template<int M> |
| Array (Array< T, M > &&other) |
|
template<int M> |
Array & | operator= (const Array< T, M > &other) |
|
template<int M> |
Array & | operator= (Array< T, M > &&other) |
|
| Array (Span< const T > span) |
|
template<typename U > |
| Array (Span< const U > span) |
|
Span< const T > | toSpanConst () const |
| Returns content of the array in a span. More...
|
|
Span< T > | toSpan () |
| Returns content of the array in a span. More...
|
|
bool | push_front (const T &value) |
| Copies an element in front of the Array, at position 0. More...
|
|
bool | push_back (const T &value) |
| Appends an element copying it at the end of the Array. More...
|
|
bool | push_back (T &&value) |
| Appends an element moving it at the end of the Array. More...
|
|
bool | pop_back (T *removedValue=nullptr) |
| Removes the last element of the array. More...
|
|
bool | pop_front (T *removedValue=nullptr) |
| Removes the first element of the array. More...
|
|
bool | reserve (size_t newCapacity) |
| Reserves memory for newCapacity elements. More...
|
|
bool | resize (size_t newSize, const T &value=T()) |
| Resizes this array to newSize, preserving existing elements. More...
|
|
bool | resizeWithoutInitializing (size_t newSize) |
| Resizes to newSize, preserving existing elements without initializing newly added ones. More...
|
|
void | clear () |
| Destroys all elements in the container, making the array empty. More...
|
|
bool | shrink_to_fit () |
| This operation is a no-op on Array. More...
|
|
bool | insert (size_t idx, Span< const T > data) |
| Inserts a range of items copying them at given index. More...
|
|
bool | append (Span< const T > data) |
| Appends a range of items copying them at the end of array. More...
|
|
bool | appendMove (Array &&other) |
| Appends another array moving its contents at the end of array. More...
|
|
bool | assign (Span< const T > data) |
| Replaces contents of the array copying elements from the span. More...
|
|
template<int M> |
bool | assign (Array< T, M > &&other) |
| Replaces contents of the array moving all elements from the other array. More...
|
|
bool | isEmpty () const |
| Returns true if the array is empty. More...
|
|
size_t | size () const |
| Returns the size of the array. More...
|
|
size_t | capacity () const |
| Returns the capacity of the array. More...
|
|
const T * | data () const |
| Gets pointer to first element of the array (or nullptr if empty) More...
|
|
T * | data () |
| Gets pointer to first element of the array (or nullptr if empty) More...
|
|
T * | begin () SC_LANGUAGE_LIFETIME_BOUND |
|
const T * | begin () const SC_LANGUAGE_LIFETIME_BOUND |
|
T * | end () SC_LANGUAGE_LIFETIME_BOUND |
|
const T * | end () const SC_LANGUAGE_LIFETIME_BOUND |
|
T & | back () SC_LANGUAGE_LIFETIME_BOUND |
|
T & | front () SC_LANGUAGE_LIFETIME_BOUND |
|
T & | operator[] (size_t idx) SC_LANGUAGE_LIFETIME_BOUND |
|
const T & | back () const SC_LANGUAGE_LIFETIME_BOUND |
|
const T & | front () const SC_LANGUAGE_LIFETIME_BOUND |
|
const T & | operator[] (size_t idx) const SC_LANGUAGE_LIFETIME_BOUND |
|
template<typename U > |
bool | contains (const U &value, size_t *index=nullptr) const |
| Return true if array contains value, returning index of found item (if != nullptr ) More...
|
|
template<typename Lambda > |
bool | find (Lambda &&lambda, size_t *index=nullptr) const |
| Finds the first item in array matching criteria given by the lambda. More...
|
|
bool | removeAt (size_t index) |
| Removes an item at a given index. More...
|
|
template<typename Lambda > |
bool | removeAll (Lambda &&criteria) |
| Removes all items matching criteria by Lambda / Functor with a bool operator()(const T&) More...
|
|
template<typename U > |
bool | remove (const U &value) |
| Removes all values equal to value More...
|
|
SegmentHeader & | unsafeGetHeader () |
|
template<typename T, int N>
struct SC::Array< T, N >
A contiguous sequence of elements kept inside its inline storage.
- Template Parameters
-
T | Type of single element of the Array |
N | Number of elements contained inside this Array inline storage |
SC::Array is like a SC::Vector but it will only allow up to N
elements in the array, using inline storage, without resorting to heap allocation.
Trying to push or insert more than N elements will fail.
Only up to SC::Array::size elements are valid (and N
- size()
are initialized).