3#ifndef pRC_CORE_VALUE_FUNCTIONS_FOLD_H
4#define pRC_CORE_VALUE_FUNCTIONS_FOLD_H
14 static inline constexpr decltype(
auto)
fold(X &&a)
18 return eval(forward<X>(a));
22 return as(forward<X>(a));
28 requires IsInvocable<F, XA, XB> &&
30 static inline constexpr decltype(
auto)
fold(XA &&a, XB &&b)
34 return eval(F()(forward<XA>(a), forward<XB>(b)));
38 return F()(forward<XA>(a), forward<XB>(b));
43 class XA,
class XB,
class... Xs>
44 requires IsInvocable<F, XA, XB> &&
51 static inline constexpr decltype(
auto)
fold(XA &&a, XB &&b, Xs &&...args)
55 auto const c = [&a, &b]() ->
decltype(
auto)
59 return eval(F()(forward<XA>(a), forward<XB>(b)));
63 return F()(forward<XA>(a), forward<XB>(b));
71 auto const c = [&b, &args...]() ->
decltype(
auto)
78 return eval(F()(forward<XA>(a), c()));
82 return F()(forward<XA>(a), c());
pRC::Size const D
Definition CalculatePThetaTests.cpp:9
Definition cholesky.hpp:10
static constexpr decltype(auto) fold(X &&a)
Definition fold.hpp:14
Direction
Definition direction.hpp:9
static constexpr RemoveConst< X > as(X &&a)
Definition basics.hpp:83
static constexpr decltype(auto) eval(X &&a)
Definition eval.hpp:12
Definition gtest_pred_impl_unittest.cc:54