Go to the documentation of this file.
15 #ifndef _FASTCDR_XCDR_OPTIONAL_HPP_
16 #define _FASTCDR_XCDR_OPTIONAL_HPP_
22 #include "../exceptions/BadOptionalAccessException.hpp"
57 const T& val) noexcept
110 bool initial_engaged =
false)
220 if (opt.storage_.engaged_)
343 explicit operator bool() const noexcept
356 #endif //_FASTCDR_XCDR_OPTIONAL_HPP_
void reset(bool initial_engaged=false)
Reset the state of the optional.
bool has_value() const
Checks whether the optional contains a value.
const T & value() const &
Returns the contained value.
optional(const T &val) noexcept
Copy constructor from an instance of the templated class.
This class is thrown as an exception when accessing the value of a null optional.
optional & operator=(const optional &opt)
Assigns content from an optional.
static const Cdr_DllAPI char *const BAD_OPTIONAL_ACCESS_MESSAGE_DEFAULT
Default message used in the library.
bool operator==(const optional &opt_val) const
Compares optional values.
An empty class type used to indicate optional type with uninitialized state.
T * operator->() noexcept
Accesses the contained value.
~optional()=default
Destructor.
bool operator!=(const optional &opt_val) const
Compares optional values.
detail::optional_storage< T > storage_
T & operator*() &noexcept
Accesses the contained value.
void emplace(Args &&... _args)
Constructs the contained value in-place.
const T & move(const T &v)
optional()=default
Default constructor.
This class template manages an optional contained value, i.e. a value that may or may not be present.
optional(T &&val) noexcept
Move constructor from an instance of the templated class.
optional(const optional< T > &val) noexcept
Copy constructor.
const T && value() const &&
Returns the contained value.
optional(optional< T > &&val) noexcept
Move constructor.
static constexpr nullopt_t nullopt
nullopt is a constant of type nullopt_t that is used to indicate optional type with uninitialized sta...
T & value() &
Returns the contained value.
T && value() &&
Returns the contained value.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45