|
tenno 0.1.0
|
An optional value. More...
#include <optional.hpp>
Public Types | |
| using | value_type = T |
| The type of the optional value. | |
Public Member Functions | |
| constexpr | optional () noexcept |
| Constructs an optional that does not contain a value. | |
| constexpr | optional (T value) noexcept |
| optional | operator= (T &value) noexcept |
| constexpr T | operator-> () const noexcept |
| constexpr T | operator* () const noexcept |
| constexpr bool | has_value () const noexcept |
| constexpr T | value () const noexcept |
| constexpr T | value_or (const T &other) const noexcept |
| Returns the value of the optional or a default value. | |
| void | swap (optional &other) noexcept |
| Swaps the optional with another optional. | |
| void | reset () noexcept |
| template<class... Args> | |
| T & | emplace (Args &&...args) |
| Constructs the value in place. | |
An optional value.
| T | The type of the optional value The optional class template manages an optional contained value, i.e. a value that may or may not be present. A common use case for optional is the return value of a function that may fail. It is also usefult for costly-to-construct objects since it avoids the need to construct them until they are needed. |
Definition at line 23 of file optional.hpp.
| using tenno::optional< T >::value_type = T |
The type of the optional value.
Definition at line 29 of file optional.hpp.
|
inlineconstexprnoexcept |
Constructs an optional that does not contain a value.
Definition at line 34 of file optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 46 of file optional.hpp.
|
inline |
Constructs the value in place.
| Args | The types of the arguments to construct the value |
| args | The arguments to construct the value |
Definition at line 114 of file optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 65 of file optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 60 of file optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 55 of file optional.hpp.
|
inlinenoexcept |
Definition at line 50 of file optional.hpp.
|
inlinenoexcept |
Definition at line 100 of file optional.hpp.
|
inlinenoexcept |
Swaps the optional with another optional.
| other | The other optional to swap with |
Definition at line 94 of file optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 70 of file optional.hpp.
|
inlineconstexprnoexcept |
Returns the value of the optional or a default value.
| other | The default value to return if the optional does not have a value |
Definition at line 82 of file optional.hpp.
| T tenno::optional< T >::_value |
Definition at line 124 of file optional.hpp.