Excellent! Thanks!
"Peter Dimov" <[EMAIL PROTECTED]> wrote in message 001901c2bbd8$b4522e90$1d00a8c0@pdimov2">news:001901c2bbd8$b4522e90$1d00a8c0@pdimov2... > From: "Steven Ketcham" <[EMAIL PROTECTED]> > > 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 > _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost