Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-06-26 12:21:01

"Douglas Gregor" <gregod_at_[hidden]> wrote in message

Subject: MPL algorithms vs. type lists

It's not abut MPL algorithms vs. type lists. MPL does have type lists.
It's about MPL algorithms versus straight recursive templates.

> 13 lines for the typelist version vs. 7 lines for the MPL version.
> important question is: which is more readable?

Fair enough. To me there's absolutely no question about which code is
more readable, but reasonable people may disagree.

STL's use of for_each et al is seriously cramped by the lack of
lambdas. That's why I believe the C++ community would not unanimously
agree that your STL example is preferable to your straight C++
example. If you ask me, I believe that forcing use of for_each and its
siblings uber alles is an emperor clothes phenomenon: we do it because
we can do it, and then we do our best to fool ourselves that we also
like it.

MPL does have lambdas, but the scarcity of the language means that it
is forced to use lead to contorsions. Those contorsions render the
code quite hard to read. I think Variant would have only to gain in
all respects if written without using mpl's facilities beyond the


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