Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.robertl / eb59.C
blob84ccff26d16314b4160f1ab7454c1fe943d0c329
1 // { dg-do run  }
2 #define INC_FUNCTIONAL  1
3 #define USE_STATIC_CAST 1
5 #include <vector>
6 #include <numeric>
7 #ifdef INC_FUNCTIONAL
8 #include <functional>
9 #endif
11 using namespace std;
13 template<class R> int p( int val, R& r )
15    return val + r;
18 template<class R> void f( vector<R>& v )
20 #ifdef USE_STATIC_CAST
21    accumulate( v.begin(), v.end(), 0, static_cast<int (*)(int, R&)>(p) );
22 #else
23    accumulate( v.begin(), v.end(), 0, p<R> );
24 #endif
27 int main()
29    vector<int> r;
30    f( r );