Hi, I try to use boost::bind instead of lambda function as the compiler is not 4.7. got the following error. any way to solve it? test.cpp: In member function void list::parallel(): test.cpp:27: error: no matching function for call to parallel_for(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, size_t, boost::_bi::bind_t, boost::_bi::list2 , boost::arg<1> > >) using namespace std; struct Obj { int32_t value; }; class list { std::vector objList; public: void process(Obj& obj) { //do something }; void parallel() { tbb::parallel_for(objList.begin(), objList.end(), size_t(1), boost::bind(&list::process, this, _1)); }; }; int main(int argc,char *argv[]) { return 1; }
parallel_for using boost bind
For more complete information about compiler optimizations, see our Optimization Notice.




