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

API reference / Collections

BasicStack class

An intrusive, unsynchronized LIFO stack.

On this page
Use
import ThinkMeta.ConcurrentTasks.Collections.BasicStack;
Namespace
ThinkMeta::ConcurrentTasks::Collections
Platforms
Windows, Linux

Syntax

template <typename T> requires std::is_base_of_v<ListEntry, T> class BasicStack

Template parameters

Ttypename
The item type; derives from ListEntry, through which items are linked.

Remarks

Items are linked through their ListEntry 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 ListEntry::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 @ c7663c4 (2026-11-19).