Template Struct OrElseWithValue
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, void, ErrorType >(Template Struct FunctionalInterfaceImpl< Derived, void, ErrorType >)
Struct Documentation
-
template<typename Derived, typename ErrorType>
struct OrElseWithValue Subclassed by iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, ErrorType >, iox::cxx::internal::FunctionalInterfaceImpl< Derived, void, ErrorType >
Public Types
-
using or_else_callback_t = cxx::function_ref<void(ErrorType&)>
-
using const_or_else_callback_t = cxx::function_ref<void(const ErrorType&)>
Public Functions
-
Derived &or_else(const or_else_callback_t &callable) & noexcept
Calls the provided callable when the object is invalid and provide the underlying error reference as argument to the callable. If the object is valid, nothing happens.
- Parameters:
callable – [in] will be called when invalid
- Returns:
reference to *this
-
const Derived &or_else(const const_or_else_callback_t &callable) const & noexcept
Calls the provided callable when the object is invalid and provide the underlying error const reference as argument to the callable. If the object is valid, nothing happens.
- Parameters:
callable – [in] will be called when invalid
- Returns:
const reference to *this
-
Derived &&or_else(const or_else_callback_t &callable) && noexcept
Calls the provided callable when the object is invalid and provide the underlying error reference as argument to the callable. If the object is valid, nothing happens.
- Parameters:
callable – [in] will be called when invalid
- Returns:
rvalue reference to *this
-
const Derived &&or_else(const const_or_else_callback_t &callable) const && noexcept
Calls the provided callable when the object is invalid and provide the underlying error const reference as argument to the callable. If the object is valid, nothing happens.
- Parameters:
callable – [in] will be called when invalid
- Returns:
const rvalue reference to *this
-
using or_else_callback_t = cxx::function_ref<void(ErrorType&)>