|
opynsim
Unofficial C++ Documentation
|
#include <value_or_sentinel.h>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | ValueOrSentinel ()=default |
| template<class U = std::remove_cv_t<T>> requires std::constructible_from<T, U&&> | |
| constexpr | ValueOrSentinel (U &&value) |
| constexpr | operator bool () const |
| constexpr const T & | operator* () const &noexcept |
| constexpr T & | operator* () &noexcept |
| constexpr const T && | operator* () const &&noexcept |
| constexpr T && | operator* () &&noexcept |
| constexpr const T & | value () const & |
| constexpr T & | value () & |
| constexpr const T && | value () const && |
| constexpr T && | value () && |
Static Public Member Functions | |
| static constexpr T | sentinel () |
Friends | |
| constexpr bool | operator== (ValueOrSentinel, ValueOrSentinel)=default |
| template<typename U > | |
| constexpr bool | operator== (const ValueOrSentinel &lhs, const U &rhs) |
| template<typename U > | |
| constexpr bool | operator== (const U &lhs, const ValueOrSentinel &rhs) |
Manages a value, or a sentinel value, which usually means "no value". Useful as an alternative to std::optional<T> when trying to save memory - and when there is an obvious sentinel value.
| using osc::ValueOrSentinel< T, Sentinel >::value_type = T |
|
constexprdefault |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
friend |
|
friend |
|
friend |