gcc/testsuite/g++.old-deja/g++.robertl/eb65.C
raw| 1 | // { dg-do run } |
| 2 | #include <iterator> |
| 3 | |
| 4 | using namespace std; |
| 5 | |
| 6 | template<size_t n, size_t i> struct PartialDotProduct { |
| 7 | template<class T> |
| 8 | static T Expand(T* a, T* b) { return T(); } |
| 9 | }; |
| 10 | |
| 11 | const int N = 10; |
| 12 | |
| 13 | template<class In1, class In2> |
| 14 | typename iterator_traits<In1>::value_type |
| 15 | dot(In1 f1, In2 f2) |
| 16 | { |
| 17 | return PartialDotProduct<N, 0>::Expand(f1, f2); // line 14 |
| 18 | } |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | double a[N], b[N]; |
| 23 | |
| 24 | double s = dot(&a[0], &b[0]); |
| 25 | } |