Boost logo

Boost :

Subject: Re: [boost] Reimplementation of the MPL for C++11
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2013-10-19 13:49:05

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.


Louis Dionne


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