Lock-free FILO stack. Uses auto-expanding freelist allocator so memory is only reclaimed upon destruction.
More...
|
| | Stack (szt capacity=0) |
| |
| | ~Stack () |
| |
| void | reserve (szt capacity) |
| | Ensure that enough storage is allocated for a number of elements. More...
|
| |
| szt | capacity () const |
| | The number of elements for which storage is allocated. More...
|
| |
| template<class T_ > |
| void | push (T_ &&val) |
| | Add new element constructed with val onto the top of the stack. More...
|
| |
| bool | pop (optional< T & > val=optnull) |
| | Remove element from the top of the stack and move it into val. Returns true on success, false if there is no element to pop. More...
|
| |
| bool | top (T &val) |
| | Get a copy of the top element. Returns true on success, false if there is no element. More...
|
| |
| void | clear () |
| | Remove all elements. More...
|
| |
| bool | empty () const |
| | Check whether the stack does not contain any elements. More...
|
| |
| szt | size () const |
| | The number of elements in the stack. More...
|
| |
template<class T>
class honey::lockfree::Stack< T >
Lock-free FILO stack. Uses auto-expanding freelist allocator so memory is only reclaimed upon destruction.