March 01, 2003
C++ Expression Templates
March 2003/C++ Expression Templates
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
Previous Page |
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
Next Page