| Line |  | 
|---|
| 1 | #ifndef BZ_ARRAYASEXPR_H | 
|---|
| 2 | #define BZ_ARRAYASEXPR_H | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef BZ_ARRAY_H | 
|---|
| 5 | #error <blitz/array/asexpr.h> must be included via <blitz/array.h> | 
|---|
| 6 | #endif | 
|---|
| 7 |  | 
|---|
| 8 | BZ_NAMESPACE(blitz) | 
|---|
| 9 |  | 
|---|
| 10 | // The traits class asExpr converts arbitrary things to | 
|---|
| 11 | // expression templatable operands. | 
|---|
| 12 |  | 
|---|
| 13 | // Default to scalar. | 
|---|
| 14 | template<class T> | 
|---|
| 15 | struct asExpr { | 
|---|
| 16 | typedef _bz_ArrayExprConstant<T> T_expr; | 
|---|
| 17 | }; | 
|---|
| 18 |  | 
|---|
| 19 | // Already an expression template term | 
|---|
| 20 | template<class T> | 
|---|
| 21 | struct asExpr<_bz_ArrayExpr<T> > { | 
|---|
| 22 | typedef _bz_ArrayExpr<T> T_expr; | 
|---|
| 23 | }; | 
|---|
| 24 |  | 
|---|
| 25 | // An array operand | 
|---|
| 26 | template<class T, int N> | 
|---|
| 27 | struct asExpr<Array<T,N> > { | 
|---|
| 28 | typedef ArrayIterator<T,N> T_expr; | 
|---|
| 29 | }; | 
|---|
| 30 |  | 
|---|
| 31 | // Index placeholder | 
|---|
| 32 | template<int N> | 
|---|
| 33 | struct asExpr<IndexPlaceholder<N> > { | 
|---|
| 34 | typedef IndexPlaceholder<N> T_expr; | 
|---|
| 35 | }; | 
|---|
| 36 |  | 
|---|
| 37 | BZ_NAMESPACE_END | 
|---|
| 38 |  | 
|---|
| 39 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.