Go to the documentation of this file.
4 #ifndef LEXY_CALLBACK_FOLD_HPP_INCLUDED
5 #define LEXY_CALLBACK_FOLD_HPP_INCLUDED
11 template <
bool Inplace>
16 template <
typename Op,
typename T,
typename... Args>
17 using type = decltype(
void(
23 template <
typename Op,
typename T,
typename... Args>
24 using type = decltype(
void(
28 template <
typename T,
typename Arg,
bool Inplace,
typename Op>
41 template <
typename... Args>
45 if constexpr (Inplace)
57 constexpr
auto sink()
const
59 if constexpr (std::is_constructible_v<T, Arg>)
67 template <
typename T,
typename Arg = T,
typename... Op>
68 constexpr
auto fold(Arg&& init, Op&&...
op)
76 template <
typename T,
typename Arg = T,
typename... Op>
88 = fold_inplace<std::size_t>(0u, [](std::size_t& result,
auto&&...) { ++result; });
91 #endif // LEXY_CALLBACK_FOLD_HPP_INCLUDED
decltype(void(_detail::invoke(LEXY_DECLVAL(Op), LEXY_DECLVAL(T &), LEXY_DECLVAL(Args)...))) type
constexpr auto fold_inplace(Arg &&init, Op &&... op)
constexpr auto sink() const
decltype(void(_detail::invoke(LEXY_DECLVAL(Op), LEXY_DECLVAL(T &&), LEXY_DECLVAL(Args)...))) type
constexpr auto count
Sink that counts all arguments.
constexpr auto invoke(F ClassT::*f, Args &&... args) -> decltype(_mem_invoker< F ClassT::* >::invoke(f, LEXY_FWD(args)...))
typename LEXY_DECAY_DECLTYPE(Operator)::op_tag_type op
constexpr auto _make_overloaded(Op &&... op)
constexpr auto operator()(Args &&... args) -> typename _fold_sfinae< Inplace >::template type< Op, T, Args &&... >
#define LEXY_EMPTY_MEMBER
#define LEXY_DECLVAL(...)
constexpr auto fold(Arg &&init, Op &&... op)
Sink that folds all the arguments with the binary operation op.