cast.cpp | cast.cpp | |||
---|---|---|---|---|
#include <blitz/array.h> | #include <blitz/array.h> | |||
#include <blitz/funcs.h> | ||||
using namespace blitz; | using namespace blitz; | |||
int main() | int main() | |||
{ | { | |||
Array<int,1> A(4), B(4); | Array<int,1> A(4), B(4); | |||
Array<float,1> C(4); | Array<float,1> C(4); | |||
A = 1, 2, 3, 5; | A = 1, 2, 3, 5; | |||
B = 2, 2, 2, 7; | B = 2, 2, 2, 7; | |||
C = A / B; | C = A / B; | |||
cout << C << endl; | cout << C << endl; | |||
#ifdef BZ_NEW_EXPRESSION_TEMPLATES | ||||
C = A / cast<float>(B); | ||||
#else | ||||
C = A / cast(B, float()); | C = A / cast(B, float()); | |||
#endif | ||||
cout << C << endl; | cout << C << endl; | |||
return 0; | return 0; | |||
} | } | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |