Boost logo

Boost Users :

From: Eelis van der Weegen (boost-users_at_[hidden])
Date: 2003-10-11 21:40:53


When Lambda's bind() is used to create a functor for dereferencing a
stored data member pointer given an instance pointer, it seems it is not
possible to pass the resulting functor a temporary instance pointer. For
example:

   #include <boost/lambda/bind.hpp>
   #include <boost/lambda/lambda.hpp>

   struct S { int i; };

   S * f ();

   void g (S * p)
   {
     using namespace boost::lambda;

     bind(&S::i, _1)(p); // ok
     bind(&S::i, _1)(p + 0); // not ok, "no match for call ..."
     bind(&S::i, _1)(f()); // not ok, "no match for call ..."
   }

Does this restriction have a purpose? If not, is this something that
needs to be (and can be) fixed?

Regards,

Eelis van der Weegen


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