Callable object invoking the callable object f with the elements of the product type unrolled as arguments.
f is applied on the fields when the input t is a record type.
- Note
- This function does not take part in overload resolution if f can't be applied to the elements of t.
#include <kumi/algorithm/apply.hpp>
template<typename Function, product_type T>
constexpr decltype(
auto)
apply_field(Function && f, T && t)
noexcept;
- f: Callable object to be invoked
- t: Product Type whose elements are used as arguments to f
template<
typename Function, kumi::concepts::record_type R>
struct apply_field
{
using type =
decltype(
kumi::apply_field(std::declval<Function>(), std::declval<R>()));
};
template<typename Function, concepts::record_type R> using apply_field_t = typename apply_field<Function, R>::type;
Computes the return type of a call to kumi::apply_field