2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-01-26 06:22:08 +00:00
Files
atomic/test/atomic_api.cpp
Andrey Semashev 2211fee1d4 Added bitwise_cast implementation based on bit_cast intrinsics.
This allows to mark bitwise_cast constexpr when the conditions to use
bit_cast are met:

 - both source and target types have the same size, and
 - the source type has no padding bits.

The latter is checked using has_unique_object_representations trait, which
we also implement using intrinsics when not available in the standard
library.

This allows atomic constructors to become constexpr for structs and floating
point types with no padding and whose size matches the atomic storage size.
2021-10-12 18:55:13 +03:00

4.1 KiB