|
Boost Users : |
Subject: Re: [Boost-users] [lambda] Boost.Bind works, labmda bind fails to compile
From: Igor R (boost.lists_at_[hidden])
Date: 2009-12-30 11:13:43
Another strange behavior:
struct Functor
{
void func1() const
{}
};
int main()
{
boost::shared_ptr<Functor> pf1;
Functor *pf2;
boost::function<void(void)> f1 = boost::bind(&Functor::func1, pf1);
// boost.bind with shared_ptr and store in function - OK
boost::lambda::bind(&Functor::func1, pf1); // labmda bind with shared_ptr - OK
boost::function<void(void)> f2 =
boost::lambda::bind(&Functor::func1, pf2); // lambda bind with regular
ptr and store in function - OK
boost::function<void(void)> f3 =
boost::lambda::bind(&Functor::func1, pf1); // lambda bind with
shared_ptr and store in function - FAILS
}
Phoenix behaves the same way.
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