BasicStack class
An intrusive, unsynchronized LIFO stack.
- Use
import ThinkMeta.ConcurrentTasks.Collections.BasicStack;- Namespace
ThinkMeta::ConcurrentTasks::Collections
Syntax
template <typename T> requires std::is_base_of_v<SLIST_ENTRY, T> class BasicStackTemplate parameters
Ttypename- The item type; derives from
SLIST_ENTRY, through which items are linked.
Remarks
Items are linked through their SLIST_ENTRY base, so pushing never allocates. Not thread-safe; see ConcurrentStack for the lock-free variant. The stack does not own its items: an item must stay alive and must not be pushed onto any other list while it is on the stack. Destroying a non-empty stack just forgets the items.
See also
Constructors
BasicStack
Methods
Push
Pushes an item on top.
Syntax
void Push(T* item) noexcept;Parameters
itemT*- Not
nullptr; itsSLIST_ENTRY::Nextis overwritten.
See also
Pop
Removes and returns the top item.
Syntax
T* Pop() noexcept;Return value
Type: T*
The top item, or nullptr if the stack is empty.
See also
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).