List-based stacks. More...
#include <ogdf/basic/SList.h>
Inheritance diagram for ogdf::StackPure< E >:Classes | |
| struct | Element |
Public Member Functions | |
| StackPure () | |
| Constructs an empty stack. More... | |
| StackPure (std::initializer_list< E > initList) | |
Constructs a stack and pushes the elements in initList on it (last element will be on top). More... | |
| StackPure (const StackPure< E > &S) | |
Constructs a stack that is a copy of S. More... | |
| StackPure (StackPure< E > &&S) | |
Constructs a stack containing the elements of S (move semantics). More... | |
| ~StackPure () | |
| Destruction. More... | |
| void | clear () |
| Makes the stack empty. More... | |
| template<class ... Args> | |
| void | emplace (Args &&... args) |
| Adds a new element at as top-most element to the stack. More... | |
| bool | empty () const |
| Returns true iff the stack is empty. More... | |
| StackPure< E > & | operator= (const StackPure< E > &S) |
| Assignment operator. More... | |
| StackPure< E > & | operator= (StackPure< E > &&S) |
| Assignment operator (move semantics). More... | |
| E | pop () |
| Removes the top-most element from the stack and returns it. More... | |
| void | print (ostream &os, char delim=' ') const |
| void | push (const E &x) |
Adds element x as top-most element to the stack. More... | |
| const E & | top () const |
| Returns a reference to the top element. More... | |
| E & | top () |
| Returns a reference to the top element. More... | |
Private Member Functions | |
| void | copy (const StackPure< E > &S) |
Private Attributes | |
| Element * | m_head |
List-based stacks.
In contrast to Stack<E>, instances of StackPure<E> do not store the number of elements contained in the stack.
| E | is the element type. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |