Stack class based on a deque.
More...
#include <Stack.h>
|
bool | IsEmpty () const |
| Returns whether or not the stack is empty. More...
|
|
void | Push (const T &item) |
| Push an item onto the stack. More...
|
|
T | Pop () |
| Pop an item from the stack and return it. More...
|
|
T & | Peek () |
| Return the topmost item on the stack without removing it. More...
|
|
const T & | Peek () const |
| Return the topmost item on the stack without removing it. More...
|
|
T & | PeekPos (size_t pos) |
| Gets item on a specified stack position without removing it. More...
|
|
const T & | PeekPos (size_t pos) const |
| Gets item on a specified stack position without removing it. More...
|
|
template<typename T>
class Stack< T >
Stack class based on a deque.
◆ IsEmpty()
template<typename T >
bool Stack< T >::IsEmpty |
( |
| ) |
const |
|
inline |
Returns whether or not the stack is empty.
- Returns
- True if the stack is empty, false if it is not.
◆ Peek() [1/2]
Return the topmost item on the stack without removing it.
- Returns
- The topmost item on the stack.
◆ Peek() [2/2]
template<typename T >
const T & Stack< T >::Peek |
( |
| ) |
const |
|
inline |
Return the topmost item on the stack without removing it.
- Returns
- The topmost item on the stack.
◆ PeekPos() [1/2]
template<typename T >
T & Stack< T >::PeekPos |
( |
size_t |
pos | ) |
|
|
inline |
Gets item on a specified stack position without removing it.
- Parameters
-
[in] | pos | The number of items to skip on the stack. |
- Returns
- The desired item from the stack.
◆ PeekPos() [2/2]
template<typename T >
const T & Stack< T >::PeekPos |
( |
size_t |
pos | ) |
const |
|
inline |
Gets item on a specified stack position without removing it.
- Parameters
-
[in] | pos | The number of items to skip on the stack. |
- Returns
- The desired item from the stack.
◆ Pop()
Pop an item from the stack and return it.
- Returns
- The value popped from the stack.
◆ Push()
template<typename T >
void Stack< T >::Push |
( |
const T & |
item | ) |
|
|
inline |
Push an item onto the stack.
- Parameters
-
[in] | item | The item to push. |
◆ stack_
template<typename T >
std::deque<T> Stack< T >::stack_ |
|
private |
The documentation for this class was generated from the following file: