Boost logo

Boost :

Subject: Re: [boost] "Simple C++11 metaprogramming"
From: Eric Niebler (eniebler_at_[hidden])
Date: 2015-08-13 14:44:53

On 7/16/2015 10:35 AM, Robert Ramey wrote:
> On 5/30/15 9:26 AM, Peter Dimov wrote:
>> I've recently made the mistake to reread Eric Niebler's excellent "Tiny
>> Metaprogramming Library" article
>> which of course prompted me to try to experiment with my own tiny
>> metaprogramming library and to see how I'd go about implementing
>> tuple_cat (a challenge Eric gives.)
>> Ordinarily, any such experiments of mine leave no trace once I abandon
>> them and move on,
> We need a permanent place for stuff like this.
>> but this time I decided to at least write an article
>> about the result, so here it is, with the hope someone might find it
>> useful. :-)
> This to me is incredible. I worthy successor to Abraham's and
> Gurtovoy's MPL book. Clearly C++/11 is going to turnout to be a major
> game changer with repercussions beyond what we can imagine now.

AFAICT, Peter's code is basically a work-alike of my Meta library [^1]
with one feature added (the ability to treat any template instance as a
typelist), and one feature removed (metafunction classes and their
associated utilities).

I really believe losing metafunction classes is a significant loss --
not so much because template template parameters are so awful (but they
kind of are), but because all the functional composition utilities
(bind, compose, curry, uncurry, on, etc.) are so incredibly useful. And
also because core issue #1430 [^2] makes it impossible to handle
variadic and fixed-arity template aliases uniformly.

Meta's approach -- borrowed from the MPL -- of quoting template template
parameters to turn them into metafunction classes (aka alias classes)
puts the workaround for #1430 in one place so that it can be ignored and

But in the end, Peter's and my thinking is pretty aligned wrt
metaprogramming in C++11 and beyond.


Eric Niebler

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