7 #include "arg_router/policy/policy.hpp"
27 template <
typename ResultType,
typename ValueType>
32 using merge_fn = std::function<void(std::optional<ResultType>&, ValueType&&)>;
45 constexpr
void merge(std::optional<ResultType>& result, ValueType&& value)
const
47 fn_(result, std::forward<ValueType>(value));
54 template <
typename ResultType,
typename ValueType>
55 struct is_policy<multi_stage_value<ResultType, ValueType>> : std::true_type {
65 template <
typename... Ts>
68 constexpr
static std::false_type test(...);
72 constexpr
static bool value = decltype(test(std::declval<T*>()))::value;
constexpr multi_stage_value(merge_fn fn) noexcept
std::function< void(std::optional< ResultType > &, ValueType &&)> merge_fn
constexpr void merge(std::optional< ResultType > &result, ValueType &&value) const
constexpr bool has_multi_stage_value_v