19 Oct
2013
19 Oct
'13
5:49 p.m.
pfultz2
Then we have O(1) lookup using decltype:
template
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