Template Struct AndThenWithValue

Inheritance Relationships

Derived Types

Struct Documentation

template<typename Derived, typename ValueType>
struct AndThenWithValue

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

Public Types

using and_then_callback_t = cxx::function_ref<void(ValueType&)>
using const_and_then_callback_t = cxx::function_ref<void(const ValueType&)>

Public Functions

Derived &and_then(const and_then_callback_t &callable) & noexcept

Calls the provided callable when the object is valid and provides the underlying value reference as argument to the callable. If the object is not valid, nothing happens.

Parameters:

callable[in] will be called when valid

Returns:

reference to *this

const Derived &and_then(const const_and_then_callback_t &callable) const & noexcept

Calls the provided callable when the object is valid and provides the underlying value const reference as argument to the callable. If the object is not valid, nothing happens.

Parameters:

callable[in] will be called when valid

Returns:

const reference to *this

Derived &&and_then(const and_then_callback_t &callable) && noexcept

Calls the provided callable when the object is valid and provides the underlying value reference as argument to the callable. If the object is not valid, nothing happens.

Parameters:

callable[in] will be called when valid

Returns:

rvalue reference to *this

const Derived &&and_then(const const_and_then_callback_t &callable) const && noexcept

Calls the provided callable when the object is valid and provides the underlying value const reference as argument to the callable. If the object is not valid, nothing happens.

Parameters:

callable[in] will be called when valid

Returns:

const rvalue reference to *this