
22 Feb
2006
22 Feb
'06
1:13 p.m.
yinglcs2@yahoo.com wrote:
I have this compile error: I did this:
std::for_each(map.begin(), map.end(), bind( &BlockList::sortY, this, *bind(&MyMap::value_type::second, _1)));
Works for me, boost 1.33 VC7.1: class A{}; typedef std::map<int, A*> MyMap; class BlockList { public: void sortY(A& a) {} void doIt() { using boost::lambda::_1; using boost::lambda::bind; MyMap map; std::for_each(map.begin(), map.end(), bind( &BlockList::sortY, this, *bind(&MyMap::value_type::second, _1))); } }; KevinH -- Kevin Heifner heifner @ ociweb.com http://heifner.blogspot.com Object Computing, Inc. (OCI) www.ociweb.com