|
| | AutoStack () noexcept |
| | Constructs an empty AutoStack.
|
| | ~AutoStack () |
| | Destroys the AutoStack. All Elements must have been destroyed beforehand.
|
| | AutoStack (const AutoStack &other)=delete |
| AutoStack & | operator= (const AutoStack &other)=delete |
| template<typename... Args> |
| Element | Push (Args &&... args) |
| | Pushes a value onto the top of the stack.
|
| ValueType & | GetTop () |
| | Returns a reference to the value at the top of the stack. The stack must not be empty.
|
| const ValueType & | GetTop () const |
| | Returns a const reference to the value at the top of the stack. The stack must not be empty.
|
| void | SetTop (const ValueType &value) |
| | Assigns a copy of the given value to the value at the top of the stack. The stack must not be empty.
|
| void | SetTop (ValueType &&value) |
| | Moves the given value into the value at the top of the stack. The stack must not be empty.
|
| bool | IsEmpty () const noexcept |
| | Returns whether the stack contains no values.
|
| bool | Contains (const ValueType &value) const |
| | Returns whether any value on the stack compares equal to the given value.
|
| Iterator | begin () noexcept |
| | Returns an Iterator referring to the value at the top of the stack.
|
| ConstIterator | begin () const noexcept |
| | Returns a ConstIterator referring to the value at the top of the stack.
|
| ConstIterator | cbegin () const noexcept |
| | Returns a ConstIterator referring to the value at the top of the stack.
|
| Iterator | end () noexcept |
| | Returns an Iterator referring to the position past the value at the bottom of the stack.
|
| ConstIterator | end () const noexcept |
| | Returns a ConstIterator referring to the position past the value at the bottom of the stack.
|
| ConstIterator | cend () const noexcept |
| | Returns a ConstIterator referring to the position past the value at the bottom of the stack.
|
template<typename ValueType>
class Bond::AutoStack< ValueType >
A stack whose elements are automatic variables.
Pushing a value onto the stack returns an Element that must be kept alive for as long as the value should remain on the stack; destroying the Element pops the value. Elements must be destroyed in reverse order of creation and must not outlive the stack. The stack cannot be copied or moved.
- Template Parameters
-
| ValueType | The type of the values held by the stack. |