Boost logo

Boost Users :

From: Darren Garvey (lists.drrngrvy_at_[hidden])
Date: 2007-02-20 21:28:50


Hi Peter,

On 20/02/07, Peter Dimov <pdimov_at_[hidden]> wrote:
>
> <snip>
> No, boost::bind( f, x, y... ) stores copies of f, x and y. Use ref(h) to
> make it store a reference. See the last paragraph of
>
> http://boost.org/libs/bind/bind.html#with_functions
>
> You might also consider using shared_ptr<holder> unless you have the
> lifetime issues already figured out.

I remember seeing ref used before. Now I know why. Thanks for the doc
pointer. And you're right about the shared_ptr, which I'm using (in a
roundabout way) in the real code.

Thanks for the reply.

Darren



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