|
|
| 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) |
| |
| template<typename U > |
| bool | contains (const U &value, size_t *index=nullptr) const |
| | Check if the current array contains a given value.
|
| |
| template<typename Lambda > |
| bool | find (Lambda &&lambda, size_t *index=nullptr) const |
| | Finds the first item in array matching criteria given by the lambda.
|
| |
| template<typename Lambda > |
| bool | removeAll (Lambda &&criteria) |
| | Removes all items matching criteria given by Lambda.
|
| |
| template<typename U > |
| bool | remove (const U &value) |
| | Removes all values equal to value
|
| |
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).
SC_TRY(myVector.push_back(1));
SC_TRY(myVector.push_back(2));
SC_TRY(myVector.push_back(3));
(void)myVector.push_back(4);
(void)myVector.pop_front();
console.
print(
"Array<int, 3> is {}", myVector.isEmpty() ?
"empty" :
"not empty");