Listing 11: Adding creator functions for each unary or binary expression

template  <class ExprT>
UnaryExpr<ExprT,double(*)(double)>
sqrt(const ExprT& e) 
{return UnaryExpr<ExprT,double(*)(double)>(e,::std::sqrt);}

template  <class ExprT>
UnaryExpr<ExprT,double(*)(double)>
exp(const ExprT& e) 
{ return UnaryExpr<ExprT,double(*)(double)>(e,::std::exp); }

...
— End of Listing —