Boost logo

Boost :

From: Gustavo Guerra (gustavobt_at_[hidden])
Date: 2002-01-15 20:51:34


----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
>
> ----- 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()).
>

Oh, I see your point. Even with the best lambda library it would
still be not pretty. It would be nice if there were a simple way
to do it like this, though. Reallity hurts :)

Gustavo Guerra


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