template <typename Value, template<class> class GrowOnlyAllocator = Loft:: Allocator>
AtomicStack struct
Thread-safe, lock-free stack based on MpmcStack and an Allocator with allows_read_after_free
.
Public functions
- auto empty() const → bool
- Return
true
if the stack holds no items. - auto pop(Value& value) → bool
- Pop
value
from top of the stack, returns ifvalue
was reassigned (true), otherwise the stack was empty. - auto push(Value&& value) → bool
- Add
value
to top of the stack, returns if the stack was empty (true). - auto push(const Value& value) → bool
- Add a copy of
value
to top of the stack, returns if the stack was empty (true).