This class template manages an optional contained value, i.e. a value that may or may not be present. More...
#include <optional.hpp>
Public Types | |
using | type = T |
Public Member Functions | |
template<class ... Args> | |
void | emplace (Args &&... _args) |
Constructs the contained value in-place. More... | |
bool | has_value () const |
Checks whether the optional contains a value. More... | |
operator bool () const noexcept | |
Checks whether the optional contains a value. More... | |
bool | operator!= (const optional &opt_val) const |
Compares optional values. More... | |
T && | operator* () &&noexcept |
Accesses the contained value. More... | |
T & | operator* () &noexcept |
Accesses the contained value. More... | |
const T && | operator* () const &&noexcept |
Accesses the contained value. More... | |
const T & | operator* () const &noexcept |
Accesses the contained value. More... | |
const T * | operator-> () const noexcept |
Accesses the contained value. More... | |
T * | operator-> () noexcept |
Accesses the contained value. More... | |
optional & | operator= (const optional &opt) |
Assigns content from an optional. More... | |
optional & | operator= (const T &val) |
Assigns content from an instance of the templated class. More... | |
optional & | operator= (nullopt_t) noexcept |
Uninitialized the optional. More... | |
optional & | operator= (optional &&opt) |
Assigns content from an optional. More... | |
optional & | operator= (T &&val) |
Assigns content from an instance of the templated class. More... | |
bool | operator== (const optional &opt_val) const |
Compares optional values. More... | |
optional ()=default | |
Default constructor. More... | |
optional (const optional< T > &val) noexcept | |
Copy constructor. More... | |
optional (const T &val) noexcept | |
Copy constructor from an instance of the templated class. More... | |
optional (optional< T > &&val) noexcept | |
Move constructor. More... | |
optional (T &&val) noexcept | |
Move constructor from an instance of the templated class. More... | |
void | reset (bool initial_engaged=false) |
Reset the state of the optional. More... | |
T & | value () & |
Returns the contained value. More... | |
T && | value () && |
Returns the contained value. More... | |
const T & | value () const & |
Returns the contained value. More... | |
const T && | value () const && |
Returns the contained value. More... | |
~optional ()=default | |
Destructor. More... | |
Private Attributes | |
detail::optional_storage< T > | storage_ |
This class template manages an optional contained value, i.e. a value that may or may not be present.
Definition at line 46 of file optional.hpp.
using eprosima::fastcdr::optional< T >::type = T |
Definition at line 50 of file optional.hpp.
|
default |
Default constructor.
|
inlinenoexcept |
Copy constructor from an instance of the templated class.
Definition at line 56 of file optional.hpp.
|
inlinenoexcept |
Move constructor from an instance of the templated class.
Definition at line 64 of file optional.hpp.
|
inlinenoexcept |
Copy constructor.
Definition at line 72 of file optional.hpp.
|
inlinenoexcept |
Move constructor.
Definition at line 80 of file optional.hpp.
|
default |
Destructor.
|
inline |
Constructs the contained value in-place.
[in] | _args | The arguments to pass to the constructor. |
Definition at line 95 of file optional.hpp.
|
inline |
Checks whether the optional contains a value.
Definition at line 196 of file optional.hpp.
|
inlineexplicitnoexcept |
Checks whether the optional contains a value.
Definition at line 343 of file optional.hpp.
|
inline |
Compares optional values.
Definition at line 264 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 301 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 277 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 313 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 289 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 337 of file optional.hpp.
|
inlinenoexcept |
Accesses the contained value.
The behavior is undefined if *this does not contain a value.
Definition at line 325 of file optional.hpp.
|
inline |
Assigns content from an optional.
Definition at line 202 of file optional.hpp.
|
inline |
Assigns content from an instance of the templated class.
Definition at line 228 of file optional.hpp.
|
inlinenoexcept |
Uninitialized the optional.
Definition at line 248 of file optional.hpp.
|
inline |
Assigns content from an optional.
Definition at line 215 of file optional.hpp.
|
inline |
Assigns content from an instance of the templated class.
Definition at line 238 of file optional.hpp.
|
inline |
Compares optional values.
Definition at line 256 of file optional.hpp.
|
inline |
Reset the state of the optional.
[in] | initial_engaged | True value initializes the state with a default instance of the templated class. False value leaves the optional in a uninitialized state. |
Definition at line 109 of file optional.hpp.
|
inline |
Returns the contained value.
exception::BadOptionalAccessException | This exception is thrown when the optional is uninitialized. |
Definition at line 129 of file optional.hpp.
|
inline |
Returns the contained value.
exception::BadOptionalAccessException | This exception is thrown when the optional is uninitialized. |
Definition at line 163 of file optional.hpp.
|
inline |
Returns the contained value.
exception::BadOptionalAccessException | This exception is thrown when the optional is uninitialized. |
Definition at line 146 of file optional.hpp.
|
inline |
Returns the contained value.
exception::BadOptionalAccessException | This exception is thrown when the optional is uninitialized. |
Definition at line 180 of file optional.hpp.
|
private |
Definition at line 350 of file optional.hpp.