|
constexpr | figment () |
| Does nothing. You have to initialize the underlying object manually.
|
|
constexpr | ~figment () |
| Does nothing. You have to destroy the underlying object manually.
|
|
template<typename... Args> |
constexpr | figment (Args &&...args) |
| Starts the lifetime of the underlying object. More...
|
|
template<typename U > |
constexpr | figment (std::initializer_list< U > list) |
| Starts the lifetime of the underlying object. More...
|
|
template<typename... Args> |
void | create (Args &&...args) |
| Starts the lifetime of the underlying object. More...
|
|
template<typename U > |
void | create (std::initializer_list< U > list) |
| Starts the lifetime of the underlying object. More...
|
|
constexpr void | destroy () |
| Destroys the underlying object, ending its lifetime.
|
|
template<typename... Args> |
constexpr void | replace (Args &&...args) |
| Replaces the underlying object. More...
|
|
template<typename U > |
constexpr void | replace (std::initializer_list< U > list) |
| Replaces the underlying object. More...
|
|
constexpr T & | to_underlying () |
| Accessor to the underlying object.
|
|
constexpr const T & | to_underlying () const |
| Accessor to the underlying object, as if it were of type std::add_const_t<T>.
|
|
constexpr decltype(auto) | begin () |
| Same as calling std::begin with the underlying object.
|
|
constexpr decltype(auto) | begin () const |
| Same as calling std::begin with the underlying object, as if it were of type std::add_const_t<T>.
|
|
constexpr decltype(auto) | end () |
| Same as calling std::end with the underlying object.
|
|
constexpr decltype(auto) | end () const |
| Same as calling std::end with the underlying object, as if it were of type std::add_const_t<T>.
|
|
constexpr T * | operator-> () |
| Accesses the members of the underlying object.
|
|
constexpr const T * | operator-> () const |
| Accesses the members of the underlying object, as if it were of type std::add_const_t<T>.
|
|
constexpr decltype(auto) | operator& () |
| Same as using the & operator in the underlying object.
|
|
constexpr decltype(auto) | operator& () const |
| Same as using the & operator in the underlying object, as if it were of type std::add_const_t<T>.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator[] (Arg &&rhs) |
| Same as using the [] operator in the underlying object.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator[] (Arg &&rhs) const |
| Same as using the [] operator in the underlying object, as if it were of type std::add_const_t<T>.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator= (Arg &&rhs) |
| Same as using the = operator in the underlying object.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator= (Arg &&rhs) const |
| Same as using the = operator in the underlying object, as if it were of type std::add_const_t<T>.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator<=> (Arg &&rhs) |
| Same as using the <=> operator in the underlying object.
|
|
template<typename Arg > |
constexpr decltype(auto) | operator<=> (Arg &&rhs) const |
| Same as using the <=> operator in the underlying object, as if it were of type std::add_const_t<T>.
|
|
template<typename Arg > |
constexpr bool | operator== (Arg &&rhs) |
| Same as using the == operator in the underlying object.
|
|
template<typename Arg > |
constexpr bool | operator== (Arg &&rhs) const |
| Same as using the == operator in the underlying object, as if it were of type std::add_const_t<T>.
|
|
constexpr | operator T& () |
| Returns a reference to the underlying object.
|
|
constexpr | operator const T & () const |
| Returns a const reference to the underlying object.
|
|
A figment holds either an object or nothing.
Holds no information whatsoever about whether or not an object is currently stored. Only use this class if the accessor code is unreachable under unsafe conditions. Managing the underlying objects' lifetime is your responsibility.
If you need a boolean flag to track the state of a figment, this isn't for you. Use an std::optional instead.
There's not much point in using a const figment. You can use a const T, or temporarily call T's const member functions using std::as_const on the figment.
- Template Parameters
-
T | Type of the underlying object |