Boost logo

Boost :

Subject: Re: [boost] Interesting article on stack-based TMP
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2012-10-22 08:26:41


On Mon, Oct 22, 2012 at 1:14 PM, Julien Nitard <julien.nitard_at_[hidden]> wrote:
> Hi All,
>
> That article came out of reddit C++ section:
>
> http://pubby8.wordpress.com/2012/10/15/stack-based-template-metaprogramming-in-c-11/
>
> It looks like TMP made easy (finally !). I am not that sure it is
> though and was wondering if anybody had any comments on it.

While I'm a fan of point-free programming, I think it the that
comparison is not completely fair; if you allow c++11 template using
syntax, then the classic MPL metafunction notation becomes:

template<typename Predicate, typename List>
struct foo: add<square<length<filter<Predicate, List>>>>, int_<5>>{};

Which is almost as good as the concatenative version. The extra <>
noise is annoying in this case, but in the general case where the
syntax tree is more complex, the classic MPL version would actually be
more readable.

Now, to make this thread on-topic: is anybody working on a C++11
rewrite of Boost.MPL?

-- gpd


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk