6#ifndef SL_UTILITY_NULLABLES_FWD_VALUE_HPP
7#define SL_UTILITY_NULLABLES_FWD_VALUE_HPP
14namespace sl::nullables::detail
16 template <input_nullable TInputNullable, std::invocable<dereference_result_t<TInputNullable>> TFunc>
17 constexpr void fwd_value(TInputNullable&& inputNullable, TFunc&& func)
19 if (inputNullable != null_v<TInputNullable>)
21 std::invoke(std::forward<TFunc>(func),
unwrap(std::forward<TInputNullable>(inputNullable)));
25 class fwd_value_caller_fn
28 template <input_nullable TInputNullable, std::invocable<dereference_result_t<TInputNullable>> TFunc>
29 constexpr void operator ()
31 TInputNullable&& inputNullable,
34 noexcept(
noexcept(
fwd_value(std::declval<TInputNullable>(), std::declval<TFunc>())))
37 std::forward<TInputNullable>(inputNullable),
38 std::forward<TFunc>(func)
68 inline constexpr auto fwd_value = []<
class Fn>(Fn&& fn)
noexcept(std::is_nothrow_constructible_v<std::remove_cvref_t<Fn>, Fn>)
The core algorithm helper, which executes the held operation when used as the right-hand-side of oper...
Definition: base.hpp:216
constexpr auto bind_back
Helper function, which generates a forwarding call wrapper for the given function and curries the par...
Definition: bind_back.hpp:100
constexpr auto fwd_value
Passes the value of the input_nullable to the function if it's not equal to its null-object.
Definition: fwd_value.hpp:68
constexpr detail::unwrap_fn unwrap
Retrieves the value of the given input_nullable.
Definition: base.hpp:160
Definition: adapter.hpp:19