C++26 Read-Write Once (Volatile Single-Access) Primitives. More...
Data Structures | |
| class | lib::rwonce::cell< T > |
| struct | lib::rwonce::detail::native_uint< usize > |
| struct | lib::rwonce::detail::native_uint< 1 > |
| struct | lib::rwonce::detail::native_uint< 16 > |
| struct | lib::rwonce::detail::native_uint< 2 > |
| struct | lib::rwonce::detail::native_uint< 4 > |
| struct | lib::rwonce::detail::native_uint< 8 > |
| class | lib::rwonce::ref< T > |
Concepts | |
| concept | lib::rwonce::detail::has_native_uint |
| concept | lib::rwonce::Word |
Typedefs | |
| template<typename T> | |
| using | lib::rwonce::detail::native_uint_t = typename native_uint<sizeof(std::remove_cv_t<T>)>::type |
Functions | |
| template<typename T> | |
| constexpr auto | lib::rwonce::read_once (const volatile T &x) noexcept -> std::remove_cv_t< T > |
| Read a memory location once without compiler caching or reordering. | |
| template<typename T> | |
| lib::rwonce::ref (T &) -> ref< T > | |
|
template<typename T> requires (!Word<T>) | |
| constexpr auto | lib::rwonce::detail::reject_unsupported_type () -> void |
| template<typename T> | |
| constexpr auto | lib::rwonce::write_once (volatile T &x, std::type_identity_t< std::remove_cv_t< T > > val) noexcept -> void |
| Write to a memory location once without compiler elision or reordering. | |
C++26 Read-Write Once (Volatile Single-Access) Primitives.
SPDX-License-Identifier: Apache-2.0
|
nodiscardconstexprexportnoexcept |
Read a memory location once without compiler caching or reordering.
| [in] | x | Memory location to read from |
|
constexprexportnoexcept |
Write to a memory location once without compiler elision or reordering.
| [out] | x | Destination memory location |
| [in] | val | Value to write |