Template Struct ValueOr
Defined in File functional_interface.hpp
Inheritance Relationships
Derived Types
public iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, ErrorType >(Template Struct FunctionalInterfaceImpl)public iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, void >(Template Struct FunctionalInterfaceImpl< Derived, ValueType, void >)
Struct Documentation
-
template<typename Derived, typename ValueType>
struct ValueOr Subclassed by iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, ErrorType >, iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, void >
Public Functions
-
template<typename U>
ValueType value_or(U &&alternative) const & noexcept When the object contains a value a copy will be returned otherwise alternative is perfectly forwarded to the ValueType constructor.
- Parameters:
alternative – [in] the return value which will be used when the object does not contain a value
- Returns:
A copy of the contained value when present otherwise return new ValueType with alternative as constructor argument
-
template<typename U>
ValueType value_or(U &&alternative) && noexcept When the object contains a value the value will be returned via move otherwise alternative is perfectly forwarded to the ValueType constructor.
- Parameters:
alternative – [in] the return value which will be used when the object does not contain a value
- Returns:
The contained value is returned via move when present otherwise return new ValueType with alternative as constructor argument
-
template<typename U>