
Thanks Jens! That works great... -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jens Theisen Sent: 21 August 2006 10:55 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Problem binding a predicate to random_shuffle() 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 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users