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> yahoo.com> 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]: github.com/ldionne/mpl11/blob/master/include/boost/mpl11/container/map.hpp


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