73 template <
typename F,
typename... Args>
92 template <
typename T,
typename... Args>
100#define CLEF_MAKE_FNT_LAZY(name) \
101 template <typename... A> \
102 auto name(A &&...__a) \
103 requires(nda::clef::is_any_lazy<A...>) \
105 return make_expr_call([](auto &&...__b) -> decltype(auto) { return name(std::forward<decltype(__b)>(__b)...); }, std::forward<A>(__a)...); \
109#define CLEF_IMPLEMENT_LAZY_METHOD(TY, name) \
110 template <typename... A> \
111 auto name(A &&...__a) \
112 requires(nda::clef::is_any_lazy<A...>) \
114 return make_expr_call( \
115 [](auto &&__obj, auto &&...__b) -> decltype(auto) { return std::forward<decltype(__obj)>(__obj).name(std::forward<decltype(__b)>(__b)...); }, \
116 *this, std::forward<A>(__a)...); \
120#define CLEF_IMPLEMENT_LAZY_CALL(...) \
121 template <typename... Args> \
122 auto operator()(Args &&...args) const & \
123 requires(nda::clef::is_any_lazy<Args...>) \
125 return make_expr_call(*this, std::forward<Args>(args)...); \
128 template <typename... Args> \
129 auto operator()(Args &&...args) & \
130 requires(nda::clef::is_any_lazy<Args...>) \
132 return make_expr_call(*this, std::forward<Args>(args)...); \
135 template <typename... Args> \
136 auto operator()(Args &&...args) && \
137 requires(nda::clef::is_any_lazy<Args...>) \
139 return make_expr_call(std::move(*this), std::forward<Args>(args)...); \
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.
Provides some utility functions and type traits for the CLEF library.