|
using | value_type = T |
|
using | array_type = std::array<value_type, MaxSize> |
|
using | pointer = array_type::pointer |
|
using | const_pointer = array_type::const_pointer |
|
using | reference = array_type::reference |
|
using | const_reference = array_type::const_reference |
|
using | iterator = array_type::iterator |
|
using | const_iterator = array_type::const_iterator |
|
using | size_type = array_type::size_type |
|
using | difference_type = array_type::difference_type |
|
|
| stack (stack const &)=delete |
|
| stack (stack &&)=delete |
|
stack & | operator= (stack const &)=delete |
|
stack & | operator= (stack &&)=delete |
|
constexpr | stack () noexcept |
| Construct an empty stack.
|
|
constexpr const_pointer | data () const noexcept |
|
constexpr pointer | data () noexcept |
|
constexpr iterator | begin () noexcept |
| Get an iterator to the first element on the stack.
|
|
constexpr const_iterator | begin () const noexcept |
| Get an iterator to the first element on the stack.
|
|
constexpr const_iterator | cbegin () const noexcept |
| Get an iterator to the first element on the stack.
|
|
constexpr iterator | end () noexcept |
| Get an iterator to the last element on the stack.
|
|
constexpr const_iterator | end () const noexcept |
| Get an iterator to the last element on the stack.
|
|
constexpr const_iterator | cend () const noexcept |
| Get an iterator to the last element on the stack.
|
|
constexpr size_type | max_size () const noexcept |
| The maximum number of elements that fit on the stack.
|
|
constexpr size_type | size () const noexcept |
| The number of elements that fit on the stack.
|
|
constexpr bool | full () const noexcept |
| Check if the stack is full.
|
|
constexpr bool | empty () const noexcept |
| Check if the stack is empty.
|
|
constexpr reference | operator[] (std::size_t index) noexcept |
| Get a reference to an element on the stack at an index.
|
|
constexpr const_reference | operator[] (std::size_t index) const noexcept |
| Get a reference to an element on the stack at an index.
|
|
constexpr reference | at (std::size_t index) noexcept |
| Get a reference to an element on the stack at an index.
|
|
constexpr const_reference | at (std::size_t index) const noexcept |
| Get a reference to an element on the stack at an index.
|
|
constexpr reference | back () noexcept |
| Get a reference to the element at the top of the stack.
|
|
constexpr const_reference | back () const noexcept |
| Get a reference to the element at the top of the stack.
|
|
template<typename... Args> |
constexpr void | emplace_back (Args &&...args) noexcept |
| Construct an object after the current top of the stack.
|
|
template<typename Arg >
requires (std::is_convertible_v<Arg, value_type>) |
constexpr void | push_back (Arg &&arg) noexcept |
| Push a new value to after the current top of the stack.
|
|
constexpr void | pop_back () noexcept |
| Remove the value at the top of the stack.
|
|
constexpr void | pop_back (const_iterator new_end) noexcept |
| Pop elements of the stack through the given iterator.
|
|
constexpr void | clear () noexcept |
| Remove all elements from the stack.
|
|
template<typename T,
std::size_t MaxSize>
class v1::stack< T, MaxSize >
A static sized stack.
This stack
class is meant to be used as a relative small object that lives in an automatic variable. The objects in this stack should be mostly trivial, as they will not be destroyed when the stack is popped or cleared.
Because the stack can not grow or shrink, the iterators remain valid over the lifetime of the stack.