Boost logo

Boost :

From: William Kempf (sirwillard_at_[hidden])
Date: 2000-11-17 18:44:18

--- In boost_at_[hidden], Jesse Jones <jejones_at_a...> wrote:
> >> My (and I think William's version) handle free functions in the
> >same way as
> >> functors are handled. Member functions need a bit more. I think
> >they should
> >> be rolled into the core callback code, but William is so far
> >unpersuaded.
> >
> >I think functors handle this. Every functor library has a way to
> >generate a "closure" form of functor. It seems wrong to duplicate
> >effort, especially when libraries specifically designed to addresss
> >this are likely to do a better job of it. However, I'm not hard
> >nosed about it, so give counter arguments for why they should be
> >addressed.
> My major qualm is that the LL is too bleeding edge. I'd hate to
have to use
> callbacks wih MSVC (or CodeWarrior?) without being able to bind

That's true today, but won't be soon (hopefully). Besides, there's
other libraries available (such as the binder library) that ARE
compatible with VC++ and still do a better job than we're likely to
add to callbacks. Seperate concepts, seperate implementations, IMHO.

> The bool conversion operator is bad because it allows you to use a
> anywhere an integral expression can be used. I guess we should do
like any
> did and use an empty method.

I'm not sure that it's much of an issue. Useage in integral
expressions won't hurt anything, it's just not very beneficial
typically. So I doubt you'll find code that uses it that way, while
it seems harmless if someone inadvertantly does.

However, I'm not opposed to using an empty() method instead.
> >I think we're crossing wires here. A closure is simple to
> >at least minimally. However, libraries like Lambda do a better job
> >than the "minimalist" approach, and if you've looked at their
> >implementation you must agree that they are a "tremendous amount of
> >effort" :).
> Certainly enough to scare me. :-) But the vast majority of
callbacks need
> nothing more than a minimalist approach, ie something that allows
you to
> bind one or more arguments of an arbitrary callback.

And if those arguments are references you have to code around it.
Etc, etc, etc. Lambda is complex for a reason. I don't think a
minimalist approach is a good idea, because it duplicates effort
while ignoring many small, but possibly critical, issues. Again,
given a compelling reason to include it I could be persuaded. No
one's really offered any, though.

Bill Kempf

Boost list run by bdawes at, gregod at, cpdaniel at, john at