Boost logo

Boost :

From: Steven Ketcham (sketcham_at_[hidden])
Date: 2003-01-14 09:41:27


Excellent!

Thanks!

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:001901c2bbd8$b4522e90$1d00a8c0_at_pdimov2...
> From: "Steven Ketcham" <sketcham_at_[hidden]>
> > MSVC 6.0
> >
> > typedef boost::function0<void> CallBackFunctionEmpty;
> > CallBackFunctionEmpty f = boost::bind(&MyClass::SomeFunction,
> > classInstance);
> >
> > The destructor of MyClass is called multiple times.
> > Is this correct?
>
> You are storing a copy of classInstance in the function object returned by
> boost::bind. If you want to store a pointer or reference, use
>
> boost::bind(&MyClass::SomeFunction, &classInstance);
>
> or
>
> boost::bind(&MyClass::SomeFunction, boost::ref(classInstance));
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk