4 #ifndef LEXY_DETAIL_STATELESS_LAMBDA_HPP_INCLUDED
5 #define LEXY_DETAIL_STATELESS_LAMBDA_HPP_INCLUDED
11 template <
typename Lambda>
14 static_assert(std::is_class_v<Lambda>);
15 static_assert(std::is_empty_v<Lambda>);
17 static constexpr Lambda
get()
19 if constexpr (std::is_default_constructible_v<Lambda>)
41 static_assert(std::is_standard_layout_v<A> && std::is_standard_layout_v<B>);
51 auto char_ptr = &storage.b.member;
54 auto b_ptr =
reinterpret_cast<B*
>(char_ptr);
57 auto lambda_ptr =
static_cast<Lambda*
>(b_ptr);
63 template <
typename... Args>
64 constexpr decltype(
auto) operator()(Args&&... args)
const
71 #endif // LEXY_DETAIL_STATELESS_LAMBDA_HPP_INCLUDED