
Hi, I need something like an abstraction layer for iterations over some range. Consider for example the following three statements, which all do the same, but the loop inside each for_each is different: // thrust is an STL-like interface for CUDA [1] thrust::device_vector< double > a1( 3 ); thrust::for_each( a1.begin() , a1.end() , op() ); std::vector< double > a2( 3 ); __gnu_parallel::for_each( a2.begin() , a2.end() , op() ); std::vector< double > a3( 3 ); std::for_each( a3.begin() , a3.end() , op() ); //maybe even fusion::vector< double , double , double > a4; fusion::for_each( a4 , op() ); Is there a way or some part of a boost-library which handles the above three statements in a unique manner? I want to write algorithms which are independent of the specific for_each implementation. Best regards, Karsten [1] http://code.google.com/p/thrust/