38 template <
class T,
class U>
52 virtual std::vector<T>
evaluate()
const;
55 virtual void print(std::ostream&,
int precedence = 99)
const;
72 template <
class T,
class U>
74 :
AList<
T>(), fun(rhs.fun), opr(rhs.opr->clone()) {}
76 template <
class T,
class U>
78 :
AList<
T>(), fun(function), opr(oper) {}
80 template <
class T,
class U>
83 template <
class T,
class U>
88 template <
class T,
class U>
91 std::vector<U> arg = opr->evaluate();
92 std::vector<T> result;
94 for (
typename std::vector<U>::size_type i = 0; i < arg.size(); ++i) {
95 result.push_back((*fun.function)(arg[i]));
112 template <
class T,
class U>
114 if (fun.precedence >= 0) {
115 if (fun.precedence <= precedence) os <<
"(";
117 opr->print(os, fun.precedence);
118 if (fun.precedence <= precedence) os <<
")";
120 os << fun.name <<
"(";
An array expression defined by a list of scalar expressions.
An array expression with one array operand.
virtual void print(std::ostream &, int precedence=99) const
Print expression.
const TFunction1< T, U > & fun
void operator=(const AUnary &)
virtual std::vector< T > evaluate() const
Evaluate.
virtual OArray< T > * clone() const
Make clone.
A pointer to an array expression.
Representation objects and parsers for attribute expressions.
A function of one U, returning a T.