Skip to content

Consistently use Atomic, and not std::atomic#10218

Open
Al2Klimov wants to merge 4 commits intomasterfrom
Atomic-not-std-atomic
Open

Consistently use Atomic, and not std::atomic#10218
Al2Klimov wants to merge 4 commits intomasterfrom
Atomic-not-std-atomic

Conversation

@Al2Klimov
Copy link
Member

Atomic enforces usage of its only safe constructor, in contrast to std::atomic.

The default-initialized std::atomic does not contain a T object, and its only valid uses are destruction and initialization by std::atomic_init, see LWG issue 2334.

-- https://en.cppreference.com/w/cpp/atomic/atomic/atomic

@Al2Klimov Al2Klimov added the core/quality Improve code, libraries, algorithms, inline docs label Nov 6, 2024
@cla-bot cla-bot bot added the cla/signed label Nov 6, 2024
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from 33181a3 to 578275e Compare November 25, 2024 09:50
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from 578275e to ae0442b Compare February 4, 2025 16:37
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from ae0442b to 3ef77a9 Compare April 30, 2025 15:33
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from 3ef77a9 to 48b5ec5 Compare May 28, 2025 15:35
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from 48b5ec5 to ed9cce5 Compare November 7, 2025 16:54
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from ed9cce5 to e423fcc Compare November 19, 2025 10:33
Atomic enforces usage of its only safe constructor,
in contrast to std::atomic.

"The default-initialized std::atomic<T> does not contain
a T object, and its only valid uses are destruction and
initialization by std::atomic_init, see LWG issue 2334."
 -- https://en.cppreference.com/w/cpp/atomic/atomic/atomic
@Al2Klimov Al2Klimov force-pushed the Atomic-not-std-atomic branch from e423fcc to f3e4917 Compare March 18, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed core/quality Improve code, libraries, algorithms, inline docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant