
21 Aug
2006
21 Aug
'06
2:54 p.m.
Nelis Franken wrote:
Any ideas anyone?
The problem is that the temporary object returned by boost::bind doesn't bind to the non-const reference random_shuffle accepts. I'm not sure if there is a nicer solution to using boost::function, as the return type of boost::bind is unspecified. #include <boost/function.hpp> void myShuffle() { boost::function< int (int) > rand = boost::bind(&Foo::customRand, this, _1); random_shuffle(dataVector.begin(), dataVector.end(), rand); } Jens