|
C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
|
Thread-safe single-value cache. More...
#include <helpers.hpp>

Public Member Functions | |
| OnceCache ()=default | |
| OnceCache (const OnceCache &other) | |
| OnceCache (OnceCache &&other) | |
| OnceCache & | operator= (const OnceCache &other) |
| OnceCache & | operator= (OnceCache &&other) |
| OnceCache & | operator= (const T &value) |
| OnceCache & | operator= (T &&value) |
| template<class F> | |
| void | call_once (F &&f) const |
| template<class... Args> | |
| T & | emplace (Args &&... args) const |
| bool | has_value () const noexcept |
| operator bool () const noexcept | |
| T & | value () |
| const T & | value () const |
| T & | operator* () |
| const T & | operator* () const |
| T * | operator-> () |
| const T * | operator-> () const |
| void | reset () const |
Thread-safe single-value cache.
| T | Value type stored in the cache |
Stores one optional value together with a std::once_flag. Use call_once() to guard lazy initialization when multiple threads may read the same object. Copying or moving a cache copies or moves the stored value, if any, and creates a fresh once flag.
Definition at line 639 of file helpers.hpp.
|
default |
|
inline |
Definition at line 643 of file helpers.hpp.
|
inline |
Definition at line 647 of file helpers.hpp.
|
inline |
Definition at line 678 of file helpers.hpp.
|
inline |
Definition at line 683 of file helpers.hpp.
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inline |
Definition at line 695 of file helpers.hpp.
|
inline |
Definition at line 697 of file helpers.hpp.
|
inline |
Definition at line 699 of file helpers.hpp.
|
inline |
Definition at line 701 of file helpers.hpp.
|
inline |
|
inline |
Definition at line 667 of file helpers.hpp.
|
inline |
|
inline |
Definition at line 672 of file helpers.hpp.
|
inline |
|
inline |
Definition at line 691 of file helpers.hpp.
|
inline |
Definition at line 693 of file helpers.hpp.