25#include "antares/expressions/nodes/Node.h"
27namespace Antares::Expressions::Nodes
33template<
typename T,
typename... Args>
34requires(std::convertible_to<Args, T> && ...)
35std::vector<T> createVector(T first, Args... args)
37 return std::vector<T>{first, args...};
46 if constexpr (
sizeof...(NodePtr))
48 operands_ = createVector(
static_cast<Node*
>(operands)...);
57 explicit SumNode(
const std::vector<Node*>& operands);
64 explicit SumNode(std::vector<Node*>&& operands):
65 operands_(std::move(operands))
76 Node* operator[](std::size_t idx)
const;
80 std::string name()
const override
86 std::vector<Node*> operands_ = {};
Base class for nodes in a syntax tree.
Definition Node.h:30
SumNode(std::vector< Node * > &&operands)
Constructs a sum node with the specified operands. Vector is moved.
Definition SumNode.h:64
const std::vector< Node * > & getOperands() const
Retrieves the operands of the sum.
Definition SumNode.cpp:31