Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-09 07:58:30


Brendan Miller wrote:
> I'm relatively new to the boost library and I'm having a problem with
> boost::signals and bind. I've reproduced the problem I'm hitting
> here.
>
> c++:
> typedef boost::signal <LRESULT (ISigSource &, LPCREATESTRUCT)>
> SigWMCreate;
> SigWMCreate sig;
> LPARAM x;
>
> boost::bind(boost::ref(sig), boost::ref(*this), _1)((LPCREATESTRUCT)(x));

[...]

> My guess is that performing the cast creates an intermediary result
> that I'm not allowed to take a reference of. Is this the case?

You are right. A fix for this problem is available in the 1.34 branch and
will be part of the next release; in the meantime, you can try replacing
boost/bind/bind_template.hpp with this version:

http://boost.cvs.sourceforge.net/boost/boost/boost/bind/bind_template.hpp?revision=1.7&view=markup

and see whether this helps.


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