On the richness of C++
Walter Bright
newshound1 at digitalmars.com
Tue Apr 15 18:46:50 PDT 2008
Edward Diener wrote:
> It is only a big deal in the sense that proving a single callback
> signature or a single event signature, rather than two of each because
> of the presumed need to support both delegates and function pointers, is
> a big deal. In other words it is much cleaner to present a single
> callable interface in a language, ala boost::function, Python callables,
> C# delegates etc etc. The callback or event does not care if the
> callable is a delegate or function pointer as long as the signature
> matches, so it is a PITA if a language can not fold both into a single
> callable concept. That is the issue and I think if you think about it
> you will realize why it is better from both a clarity and ease of use
> perspective to have a single callable representing both. There is no
> sense in a language as rich as D to have to move backward from what
> other other good languages are able to represent.
There's no reason you cannot write a template in D to do it - Andrei has
done so in his std.algorithms code.
More information about the Digitalmars-d
mailing list