Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-15 19:55:55


----- Original Message -----
From: "Gustavo Guerra" <gustavobt_at_[hidden]>

> Why don't we drop get and release and instead put something like this:
>
> template<T>
> class shared_ptr
> {
> private:
> T* ptr;
> public:
> template<class F>
> void call_legacy_function(F callback)
> {
> callback(ptr);
> }
> };
>
> Of course the callback could still do something bad with the pointer, but
> it's more localized.

I have a function that takes 3 pointers as arguments. Now they've all been
changed to shared_ptrs. Show me how that function can be called (I know how
to do it, but it isn't pretty, even with bind()).

-Dave


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