|
| | ArrayList ()=default |
| | default constructor
|
| |
| template<std::convertible_to< T > Ta, size_t N1> |
| | ArrayList (const ArrayList< Ta, N1 > &other) |
| | default copy constructor
|
| |
| template<std::convertible_to< T > Ta, size_t N1> |
| ArrayList & | operator= (const ArrayList< Ta, N1 > &other) |
| | default copy assignment
|
| |
| template<std::convertible_to< T > Ta> |
| | ArrayList (std::initializer_list< Ta > ilist) |
| | construct from an initialiser list
|
| |
| template<std::ranges::forward_range Range> |
| | ArrayList (const Range &range) |
| | construct from an generic range that follows the concept std::ranges::forward_range
|
| |
| | ~ArrayList () |
| | destructor
|
| |
| constexpr size_type | size () const |
| | returns the size/count of live elements in the container
|
| |
| constexpr size_type | capacity () const |
| | returns the capacity of the container. Since this is a statically allocated container this is also the maximal size.
|
| |
| constexpr size_type | max_size () const |
| | returns the maximal number of elements that can be stored in the container
|
| |
| constexpr size_type | reserve () const |
| | returns the reserve - number of elements that can be stored until the container is full
|
| |
| constexpr bool | empty () const |
| | returns true if there are not elements in the container, aka. the container is empty.
|
| |
| constexpr bool | full () const |
| | returns true if the container is full and no more elements can be stored in the container
|
| |
| constexpr pointer | data () |
| | returns a pointer to the start of the container
|
| |
| constexpr const_pointer | data () const |
| | returns a const-pointer to the start of the container
|
| |
| constexpr const_pointer | cdata () const |
| | returns a const-pointer to the start of the container
|
| |
| constexpr iterator | begin () |
| | returns an iterator to the start
|
| |
| constexpr const_iterator | begin () const |
| | returns a const-iterator to the start
|
| |
| constexpr const_iterator | cbegin () const |
| | returns a const-iterator to the start
|
| |
| constexpr iterator | end () |
| | returns an iterator past the end
|
| |
| constexpr const_iterator | end () const |
| | returns a const-iterator past the end
|
| |
| constexpr const_iterator | cend () const |
| | returns a const-iterator past the end
|
| |
| constexpr reference | front () |
| | returns a reference to the first element in the buffer
|
| |
| constexpr const_reference | front () const |
| | returns a const-reference to the first element int the buffer
|
| |
| constexpr reference | back () |
| | returns a reference to the last element in the buffer
|
| |
| constexpr const_reference | back () const |
| | returns a const reference to the last element in the buffer
|
| |
| template<std::integral Int> |
| constexpr reference | at (const Int i) |
| | returns a reference to the element at the given position
|
| |
| template<std::integral Int> |
| constexpr const_reference | at (const Int i) const |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| ArrayList< T, N > | at (const ArrayList< bool, N > &mask) const |
| | Masked indexing.
|
| |
| template<std::integral Int> |
| ArrayList< T, N > | at (const ArrayList< Int, N > &indices) const |
| | Indices list indexing.
|
| |
| template<std::integral Int> |
| constexpr reference | operator[] (const Int i) |
| | returns a reference to the element at the given position
|
| |
| template<std::integral Int> |
| constexpr const_reference | operator[] (const Int i) const |
| | returns a reference to the element at the given position
|
| |
| ArrayList< T, N > | operator[] (const ArrayList< bool, N > &mask) const |
| | accesses all elements where mask is true
|
| |
| template<std::integral Int> |
| ArrayList< T, N > | operator[] (const ArrayList< Int, N > &indices) const |
| | accesses all elements at the given indices
|
| |
| template<class... Args> |
| T & | emplace_back (Args &&... args) |
| | emplaces (aka. pushes) an element to the back of the list
|
| |
| void | clear () |
| | clears the list - destructs all members if necessary and sets the size to zero
|
| |
| void | append (const size_type count, const T &value) |
| | appends value count many times
|
| |
| void | assign (const size_type count, const T &value) |
| | clears the list and assigns the value count many times to the list.
|
| |
template<std::forward_iterator Itr>
requires std::convertible_to<typename std::iterator_traits<Itr>::value_type, T> |
| void | append (Itr first, Itr last) |
| | appends a range defined by foreward iterators using the closed-open principle [first, last)
|
| |
template<std::forward_iterator Itr>
requires std::convertible_to<typename std::iterator_traits<Itr>::value_type, T> |
| void | assign (Itr first, Itr last) |
| | assigns a range defined by foreward iterators using the closed-open principle [first, last). After the assignment the list has the size of the assigned range
|
| |
| template<std::convertible_to< T > Ta> |
| void | append (std::initializer_list< Ta > ilist) |
| | appens an initilizer_list
|
| |
| template<std::convertible_to< T > Ta> |
| void | assign (std::initializer_list< Ta > ilist) |
| | assigns an initializer_list
|
| |
| template<std::ranges::forward_range Range> |
| void | append (const Range &range) |
| | Appends the content of a range.
|
| |
| template<std::ranges::forward_range Range> |
| void | assign (const Range &range) |
| | Assigns the content of a range.
|
| |
| constexpr size_type | to_index (const const_iterator pos) const |
| | turns the passed position given by an iterator into an integer
|
| |
| template<std::integral Int> |
| constexpr iterator | to_iterator (const Int pos) |
| | turns the passed unsigned integer into an iterator pointing to the same position
|
| |
| template<std::integral Int> |
| constexpr const_iterator | to_iterator (const Int pos) const |
| | turns the passed unsigned integer into a cosnt_iterator pointing to the same position
|
| |
| template<std::integral Int> |
| constexpr const_iterator | to_const_iterator (const Int pos) const |
| | turns the passed unsigned integer into a cosnt_iterator pointing to the same position
|
| |
| constexpr iterator | unconst (const const_iterator pos) |
| | removes the constnes of an iterator if the user has access to the mutable (un-const) container
|
| |
| template<std::convertible_to< T > Ta> |
| iterator | insert (const const_iterator pos, const Ta &value) |
| | Inserts a value.
|
| |
| template<std::convertible_to< T > Ta> |
| iterator | insert (const const_iterator pos, Ta &&value) |
| | Inserts a value.
|
| |
template<std::forward_iterator Itr>
requires std::convertible_to<typename std::iterator_traits<Itr>::value_type, T> |
| iterator | insert (const const_iterator pos, Itr first, Itr last) |
| | inserts a range at a given position
|
| |
| template<std::ranges::forward_range Range> |
| iterator | insert (const const_iterator pos, const Range &range) |
| | inserts a range at the given position
|
| |
| template<std::integral Int> |
| iterator | insert (const Int index, const T &value) |
| | inserts the value at the position passed as an integer that wraps if it is a signed type
|
| |
| template<std::integral Int, std::convertible_to< T > Ta> |
| iterator | insert (const Int index, Ta &&value) |
| | inserts the value at the position passed as an integer that wraps if it is a signed type
|
| |
| template<std::integral Int, std::ranges::forward_range Range> |
| iterator | insert (const Int index, const Range &range) |
| | inserts the range at the position passed as an integer that wraps if it is a signed type
|
| |
template<std::integral Int, std::forward_iterator Itr>
requires std::convertible_to<typename std::iterator_traits<Itr>::value_type, T> |
| iterator | insert (const Int index, Itr first, Itr last) |
| | inserts the closed-open [first, last) range at the given position
|
| |
| iterator | erase (const_iterator cpos) |
| | erases/removes the element at the position pointed to by cpos
|
| |
template<class Int>
requires std::is_integral_v<Int> |
| iterator | erase (const Int pos) |
| | erases/removes the element at the position pointed to by cpos
|
| |
| iterator | erase (const_iterator first, const_iterator last) |
| | erases/removes the range given by the closed-open iterators [first, last)
|
| |
| template<class Callable> |
| std::size_t | erase_if (Callable &&f) |
| | erases elements from the list if they satisfy the callable
|
| |
template<class Int>
requires std::is_integral_v<Int> |
| iterator | erase (Int first, Int last) |
| | erases/removes the range given by the closed-open indices [first, last)
|
| |
| void | pop_back () |
| | removes and destructs the last element
|
| |
| ArrayList< bool, N > | operator! () const |
| | Applies the negation (!) operator to all elements and returns it as a bool list.
|
| |
| template<class Function> |
| constexpr void | for_each (Function &&function) |
| | Applies the function to each element of the list in-place.
|
| |
template<class T, std::size_t N>
class fiber::ArrayList< T, N >
An array of contiguous memory which is statically allocated.
Failure Modes and Effects Analysis
- Template Parameters
-
| T | type of the data elements |
| N | size/count of the elements in the container |