From: Douglas Gregor (gregod_at_[hidden])
Date: 2000-11-23 10:37:37
On Wed, 22 Nov 2000 19:46:55 +0000
Kevlin Henney <kevlin_at_[hidden]> wrote:
> In message <20001122115414.413e08c0.gregod_at_[hidden]>, Douglas Gregor
> <gregod_at_[hidden]> writes
> >On Wed, 22 Nov 2000 07:04:04 +0000
> >Kevlin Henney <kevlin_at_[hidden]> wrote:
> >> As another point, is there a reason that pointers are restricted to raw
> >> pointers? This restriction is not necessary -- see http://www.cuj.com/ex
> >> perts/1811/henney_x.html which allows other smart object pointers.
> >I'll stick my neck out to say that most of us are under the assumption that
> >callbacks will be used with a more powerful library (e.g., Lambda) instead of
> >attempting to duplicate its functionality.
> This is really an issue with the way that Jesse's implementation handles
> pointers and pointers to member functions, rather than how the
> functional side of things is to be used with these classes in general.
> Currently that callback class restricts pointers to objects to be raw
> pointers, whereas it could work easily with smart pointers as well.
True, and this is not a necessary restriction.
> There is also the question as to whether the function pointer class
> should be given a wrapped and bound member function pointer, or whether
> it should wrap it itself. I have implementations of both, and am
Personally, I prefer a make_callback function which will wrap everything up in a functor. Lambda is better at this, of course, but supplying make_callback will allow weaker compilers to use callbacks and will decouple us from the Lambda library (which may scare off potential users <g>).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk