62 template <
typename F,
typename... Args>
81 template <
typename T,
typename... Args>
89#define CLEF_MAKE_FNT_LAZY(name) \
90 template <typename... A> \
91 auto name(A &&...__a) \
92 requires(nda::clef::is_any_lazy<A...>) \
94 return make_expr_call([](auto &&...__b) -> decltype(auto) { return name(std::forward<decltype(__b)>(__b)...); }, std::forward<A>(__a)...); \
98#define CLEF_IMPLEMENT_LAZY_METHOD(TY, name) \
99 template <typename... A> \
100 auto name(A &&...__a) \
101 requires(nda::clef::is_any_lazy<A...>) \
103 return make_expr_call( \
104 [](auto &&__obj, auto &&...__b) -> decltype(auto) { return std::forward<decltype(__obj)>(__obj).name(std::forward<decltype(__b)>(__b)...); }, \
105 *this, std::forward<A>(__a)...); \
109#define CLEF_IMPLEMENT_LAZY_CALL(...) \
110 template <typename... Args> \
111 auto operator()(Args &&...args) const & \
112 requires(nda::clef::is_any_lazy<Args...>) \
114 return make_expr_call(*this, std::forward<Args>(args)...); \
117 template <typename... Args> \
118 auto operator()(Args &&...args) & \
119 requires(nda::clef::is_any_lazy<Args...>) \
121 return make_expr_call(*this, std::forward<Args>(args)...); \
124 template <typename... Args> \
125 auto operator()(Args &&...args) && \
126 requires(nda::clef::is_any_lazy<Args...>) \
128 return make_expr_call(std::move(*this), std::forward<Args>(args)...); \
Provides some utility functions and type traits for the CLEF library.
Provides a basic lazy expression type for the clef library.
auto make_expr(T &&t)
Create a terminal expression node of an object.
auto make_expr_subscript(T &&t, Args &&...args)
Create a subscript expression from an object and a list of arguments.
auto make_expr_call(F &&f, Args &&...args)
Create a function call expression from a callable object and a list of arguments.
auto make_expr_from_clone(T &&t)
Create a terminal expression node of an object.
typename detail::expr_storage_impl< T >::type expr_storage_t
Type trait to determine how a type should be stored in an expression tree, i.e. either by reference o...
constexpr bool is_any_lazy
Constexpr variable that is true if any of the given types is lazy.
Single node of the expression tree.