Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Collections

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 BasicStack

Template 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

ConcurrentStack

Constructors

BasicStack

Constructs an empty stack.

Syntax

BasicStack() noexcept = default;

Methods

Push

Pushes an item on top.

Syntax

void Push(T* item) noexcept;

Parameters

itemT*
Not nullptr; its SLIST_ENTRY::Next is overwritten.

See also

Pop

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

Push

Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).