1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
template <class T, class U>
struct BinaryOp<T, U, Add> : public BinaryOpBase<T, U>{
BinaryOp(T I1, U I2) : BinaryOpBase<T, U>(I1, I2){}
inline double operator *() {return *BinaryOpBase<T, U>::It1 + *BinaryOpBase<T, U>::It2;}
};
template <class T, class U>
struct BinaryOp<T, U, Mult> : public BinaryOpBase<T, U>{
BinaryOp(T I1, U I2) : BinaryOpBase<T, U>(I1, I2){}
inline double operator *() {return *BinaryOpBase<T, U>::It1 * *BinaryOpBase<T, U>::It2;}
};
template <class T, class U>
struct BinaryOp<T, U, Sub> : public BinaryOpBase<T, U>{
BinaryOp(T I1, U I2) : BinaryOpBase<T, U>(I1, I2){}
inline double operator *() {return *BinaryOpBase<T, U>::It1 - *BinaryOpBase<T, U>::It2;}
};
template <class T, class U>
struct BinaryOp<T, U, Div> : public BinaryOpBase<T, U>{
BinaryOp(T I1, U I2) : BinaryOpBase<T, U>(I1, I2){}
inline double operator * () {return *BinaryOpBase<T, U>::It1 / *BinaryOpBase<T, U>::It2;}
};
|