|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-13 07:20:17
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>
> David Abrahams wrote:
> > > Sorry, but I do not agree. Peter's and Andrei's versions are
> > > easier to understand. At least for me (no offense meant :-)
> >
> > Even I have to agree with that part.
>
> Then, I guess, I am better acquainted with one of the central
functional
> programming algorithms ('fold') than anyone participating in this
discussion
> :). Kind of surprising :).
It's not 'fold', but the other stuff used by MPL to ensure generality
which steepens the learning curve, IMO. I'm thinking of things like,
e.g., using integer_c in place of normal static integer constants. The
complication in http://lists.boost.org/MailArchives/boost/msg28148.php
is almost entirely due to that, and it's an idea that's likely to be
foreign even to people who have done some trivial metaprogramming.
Once you understand that only types (not integers or templates) can be
manipulated in a general way by the template system, you begin to
appreciate the elegance of "next<N>::type" instead of "n + 1" and using
metafunction classes in place of ordinary metafunctions. Until then,
however, it just looks like a whole lot of extra complication. And, BTW,
isn't there a meta-lambda version of the above which simplifies things a
bit?
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk