OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb59.C] - Rev 823

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do run  }
#define INC_FUNCTIONAL  1
#define USE_STATIC_CAST 1

#include <vector>
#include <numeric>
#ifdef INC_FUNCTIONAL
#include <functional>
#endif

using namespace std;

template<class R> int p( int val, R& r )
{
   return val + r;
}

template<class R> void f( vector<R>& v )
{
#ifdef USE_STATIC_CAST
   accumulate( v.begin(), v.end(), 0, static_cast<int (*)(int, R&)>(p) );
#else
   accumulate( v.begin(), v.end(), 0, p<R> );
#endif
}

int main()
{
   vector<int> r;
   f( r );
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.