Go to the documentation of this file.
4 #ifndef LEXY_CALLBACK_BASE_HPP_INCLUDED
5 #define LEXY_CALLBACK_BASE_HPP_INCLUDED
16 constexpr
bool is_callback = _detail::is_detected<_detect_callback, T>;
18 template <
typename T,
typename... Args>
20 template <
typename T,
typename... Args>
22 = _detail::is_detected<_detect_callback_for, std::decay_t<T>, Args...>;
24 template <
typename T,
typename State>
26 template <
typename T,
typename State>
28 = _detail::is_detected<_detect_callback_state, T, std::decay_t<State>>;
30 template <
typename T,
typename State,
typename... Args>
33 template <
typename T,
typename State,
typename... Args>
35 = _detail::is_detected<_detect_callback_with_state_for, std::decay_t<T>, State, Args...>;
38 template <
typename Sink,
typename... Args>
41 template <
typename T,
typename... Args>
43 template <
typename T,
typename... Args>
45 = _detail::is_detected<_detect_sink_callback_for, std::decay_t<T>, Args...>;
47 template <
typename T,
typename... Args>
49 template <
typename T,
typename... Args>
55 template <
typename Fn>
62 template <
typename... Args>
70 template <
typename Fn>
73 template <
typename... Fns>
81 template <
typename... Op>
84 if constexpr (
sizeof...(Op) == 1)
91 #endif // LEXY_CALLBACK_BASE_HPP_INCLUDED
constexpr bool is_detected
constexpr bool is_callback_for
decltype(LEXY_DECLVAL(Sink).sink(LEXY_DECLVAL(Args)...)) sink_callback
Returns the type of the .sink() function.
decltype(LEXY_DECLVAL(T &)(LEXY_DECLVAL(Args)...)) _detect_sink_callback_for
typename T::return_type _detect_callback
decltype(LEXY_DECLVAL(const T)[LEXY_DECLVAL(State &)]) _detect_callback_state
constexpr _overloaded(Fns... fns)
constexpr bool is_callback_state
constexpr bool is_callback_with_state_for
constexpr bool is_callback
constexpr _fn_holder(Fn fn)
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 operator()(Args &&... args) const -> decltype(_detail::invoke(fn, LEXY_FWD(args)...))
constexpr bool is_sink_callback_for
constexpr auto _make_overloaded(Op &&... op)
decltype(LEXY_DECLVAL(const T)(LEXY_DECLVAL(Args)...)) _detect_callback_for
#define LEXY_DECLVAL(...)
decltype(LEXY_DECLVAL(const T)[LEXY_DECLVAL(State &)](LEXY_DECLVAL(Args)...)) _detect_callback_with_state_for
decltype(LEXY_DECLVAL(const T).sink(LEXY_DECLVAL(Args)...).finish()) _detect_sink
std::conditional_t< std::is_class_v< Fn >, Fn, _fn_holder< Fn > > _fn_as_base