0

Hi,

Please advise how to bind std::sort with boost::thread.

I'm trying to do:

boost::thread_group thg;
thg.create_thread(boost::bind(sort<vector<int>::iterator>, mass.begin(), mass.end()));

and get: ThreadSort/main.cpp:40:0 /Users/Maxim/Documents/Projects/SW/C++/ThreadSort/main.cpp:40: error: no matching function for call to 'bind(<unresolved overloaded function type>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >)'

Please HELP!!!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by MaximNM
0

I have found the solution!!!

boost::thread_group thg;
thg.create_thread(boost::bind(static_cast<void(*)(vector<int>::iterator,vector<int>::iterator)>(sort<vector<int>::iterator>), mass.begin(), mass.end()));

In any case thanks all of you!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.