|
tenno 0.1.0
|
A fixed-size array. More...
#include <array.hpp>
Data Structures | |
| struct | const_iterator |
| A const iterator to iterate over the array. More... | |
| struct | const_reverse_iterator |
| A const iterator to iterate over the array. More... | |
| struct | iterator |
| An iterator to iterate over the array. More... | |
| struct | reverse_iterator |
| A reverse iterator over the array. More... | |
Public Types | |
| using | value_type = T |
| The type of the elements in the array. | |
Public Member Functions | |
| constexpr | array () |
| Construct a new array object. | |
| constexpr | array (std::initializer_list< T > list) |
| Construct a new array object with a list of elements. | |
| constexpr | array (const array &other) |
| constexpr tenno::size | size () const noexcept |
| Get the size of the array. | |
| constexpr tenno::expected< T, tenno::error > | at (const tenno::size index) const noexcept |
| Access an element of the array. | |
| constexpr T | front () const noexcept |
| Access an element of the array. | |
| constexpr T | back () const noexcept |
| Access an element of the array. | |
| T * | data () noexcept |
| Access an element of the array. | |
| constexpr const T * | data () const noexcept |
| Access the underlying data of the array. | |
| constexpr bool | empty () const noexcept |
| Check if the array is empty. | |
| constexpr tenno::size | max_size () const noexcept |
| Get the maximum size of the array. | |
| void | fill (const T &value) noexcept |
| Fill the array with a value. | |
| void | swap (array &other) noexcept |
| Swap the contents of the array with another array. | |
| constexpr T & | operator[] (const tenno::size index) noexcept |
| Access an element of the array. | |
| constexpr const T & | operator[] (const tenno::size index) const noexcept |
| Access an element of the array constexpr. | |
| constexpr array & | operator= (const array &other) noexcept |
| iterator | begin () noexcept |
| Get an iterator to the beginning of the array. | |
| iterator | end () noexcept |
| Get an iterator to the end of the array. | |
| constexpr const_iterator | cbegin () const noexcept |
| Get an const_iterator to the beginning of the array. | |
| constexpr const_iterator | cend () const noexcept |
| Get an const_iterator to the end of the array. | |
| reverse_iterator | rbegin () noexcept |
| Get an reverse_iterator to the beginning of the array. | |
| reverse_iterator | rend () noexcept |
| Get an reverse_iterator to the end of the array. | |
| constexpr const_reverse_iterator | crbegin () const noexcept |
| Get an const_reverse_iterator to the beginning of the array. | |
| constexpr const_reverse_iterator | crend () const noexcept |
| Get an const_reverse_iterator to the end of the array. | |
Static Public Member Functions | |
| static constexpr T | generate_default () |
| static constexpr tenno::array< T, N > | init () noexcept |
| Initialize all elements of the array to the default value of T. | |
A fixed-size array.
| T | The type of the elements in the array |
| N | The size of the array |
No memory allocation is performed, and the array is stored on the stack.
| using tenno::array< T, N >::value_type = T |
|
inlineconstexpr |
|
inlineconstexpr |
Construct a new array object with a list of elements.
| list | The list of elements to initialize the array with |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Access an element of the array.
| index | The index of the element to access |
|
inlineconstexprnoexcept |
Access an element of the array.
| index | The index of the element to access |
|
inlinenoexcept |
Get an iterator to the beginning of the array.
|
inlineconstexprnoexcept |
Get an const_iterator to the beginning of the array.
|
inlineconstexprnoexcept |
Get an const_iterator to the end of the array.
|
inlineconstexprnoexcept |
Get an const_reverse_iterator to the beginning of the array.
|
inlineconstexprnoexcept |
Get an const_reverse_iterator to the end of the array.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Access an element of the array.
| index | The index of the element to access |
|
inlineconstexprnoexcept |
Check if the array is empty.
|
inlinenoexcept |
Get an iterator to the end of the array.
|
inlinenoexcept |
Fill the array with a value.
| value | The value to fill the array with |
|
inlineconstexprnoexcept |
Access an element of the array.
| index | The index of the element to access |
|
inlinestaticconstexpr |
|
inlinestaticconstexprnoexcept |
Initialize all elements of the array to the default value of T.
|
inlineconstexprnoexcept |
Get the maximum size of the array.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Access an element of the array.
| index | The index of the element to access |
|
inlinenoexcept |
Get an reverse_iterator to the beginning of the array.
|
inlinenoexcept |
Get an reverse_iterator to the end of the array.
|
inlineconstexprnoexcept |
Get the size of the array.
|
inlinenoexcept |
Swap the contents of the array with another array.
| other | The other array to swap with |