Boost logo

Boost :

Subject: Re: [boost] Reimplementation of the MPL for C++11
From: Larry Evans (cppljevans_at_[hidden])
Date: 2013-10-20 07:23:40

On 10/19/13 12:49, Louis Dionne wrote:
> pfultz2 <pfultz2 <at>> writes:
> [...]
>> Then we have O(1) lookup using decltype:
>> template<class Vector, class Index>
>> struct at
>> {
>> typedef decltype(Vector::item_(Index())) type;
>> };
>> I haven't tested this code yet, but the Boost.MPL works in a similiar way
>> for compilers that suppor typeof. Of course generating the `item_` overloads
> [...]
> That's how the map is currently implemented, but I don't use the preprocessor
> to generate overloads.
> See the top of [1] for details, it's pretty simple.
> Regards,
> Louis Dionne
> [1]:
Hi Dionne,

I tried variadic templates several years ago.
The code is here:

Unfortunately, as Eric and Mathias already hinted, the compile
times are much slower than with the existing mpl. The existing
mpl uses the preprocessor to lessen compile times, a method
mentioned by Eric in his (b) item:

   (b) using the preprocessor and living with arbitrary limits.

Christopher Schmidt used the preprocessor to implement
a variadic fusion using the help of the preprocessor to lessen
compile times but, IIUC, he used some method (I'll call it
"chunking") so that the preprocessor didn't have arbitrary

NOTE: I tried the link in that post to Christopher's code
and it no longer works :( However, I'm sure Christopher
(if you can find his email address) would be able to
supply an update location for the code. You might could
use the chunking method to minimize the compile times.


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