Template Struct OrElse

Inheritance Relationships

Derived Types

Struct Documentation

template<typename Derived>
struct OrElse

Subclassed by iox::cxx::internal::FunctionalInterfaceImpl< Derived, ValueType, void >, iox::cxx::internal::FunctionalInterfaceImpl< Derived, void, void >

Public Types

using or_else_callback_t = cxx::function_ref<void()>

Public Functions

Derived &or_else(const or_else_callback_t &callable) & noexcept

Calls the provided callable when the object is invalid. If the object is valid, nothing happens.

Parameters:

callable[in] will be called when invalid

Returns:

reference to *this

const Derived &or_else(const or_else_callback_t &callable) const & noexcept

Calls the provided callable when the object is invalid. 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. 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 or_else_callback_t &callable) const && noexcept

Calls the provided callable when the object is invalid. If the object is valid, nothing happens.

Parameters:

callable[in] will be called when invalid

Returns:

const rvalue reference to *this