Boost logo

Boost Users :

From: Kevin Heifner (heifner_k_at_[hidden])
Date: 2006-02-22 15:13:25


yinglcs2_at_[hidden] 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net