22 template <
typename TagType,
24 template <
typename>
class ResultExprType,
27 typename... OperandTypes>
28 struct generic_expr :
public ResultExprType<generic_expr<TagType,
49 static constexpr
bool is_terminal =
sizeof...(OperandTypes) == NParameters;
51 static constexpr
size_t tag = Tag;
55 std::tuple<OperandTypes...>
exprs;
58 inline decltype(
auto)
operands() const noexcept;
61 inline decltype(auto)
parameters() const noexcept;
64 inline decltype(auto)
first() const noexcept;
65 inline decltype(auto)
second() const noexcept;
76 inline ResultType
eval() const;
88 typename T = ResultType,
89 typename = typename
std::enable_if<
std::is_same<T, ResultType>::value &&
95 template <typename TagType,
96 template <typename> class ResultExprType,
104 template <typename TagType,
105 template <typename> class ResultExprType,
110 generic_expr<TagType, 0, ResultExprType, ResultType, 0, LhsExpr, RhsExpr>;
113 #include <mgcpp/expressions/generic_expr.tpp> 114 #endif // GENERIC_OP_HPP decltype(auto) first() const noexcept
decltype(auto) operands() const noexcept
Definition: adapter_base.hpp:12
static constexpr size_t tag
Definition: generic_expr.hpp:51
Definition: eval_context.hpp:20
Definition: shape_type.hpp:11
Definition: forward.hpp:25
ResultType result_type
Definition: generic_expr.hpp:43
ResultExprType< T > result_expr_type
Definition: generic_expr.hpp:46
decltype(auto) second() const noexcept
generic_expr(OperandTypes... args) noexcept
static constexpr bool is_terminal
Definition: generic_expr.hpp:49
generic_expr< TagType, Tag, ResultExprType, ResultType, NParameters, OperandTypes... > this_type
Definition: generic_expr.hpp:40
std::tuple< OperandTypes... > exprs
Definition: generic_expr.hpp:55
decltype(auto) parameters() const noexcept
static constexpr size_t n_parameters
Definition: generic_expr.hpp:50