11 #ifndef TLX_META_FOLD_LEFT_HEADER 12 #define TLX_META_FOLD_LEFT_HEADER 26 namespace meta_detail {
29 template <
typename Reduce,
typename Initial,
typename Arg>
31 return std::forward<Reduce>(r)(
32 std::forward<Initial>(init), std::forward<Arg>(arg));
36 template <
typename Reduce,
typename Initial,
typename Arg,
typename... MoreArgs>
38 Arg&& arg, MoreArgs&& ... rest) {
40 std::forward<Reduce>(r),
41 std::forward<Reduce>(r)(
42 std::forward<Initial>(init), std::forward<Arg>(arg)),
43 std::forward<MoreArgs>(rest) ...);
50 template <
typename Reduce,
typename Initial,
typename... Args>
51 auto fold_left(Reduce&& r, Initial&& init, Args&& ... args) {
53 std::forward<Reduce>(r), std::forward<Initial>(init),
54 std::forward<Args>(args) ...);
61 #endif // !TLX_META_FOLD_LEFT_HEADER