
"Joaquín Mª López Muñoz" <joaquin@tid.es> wrote
Why not use an MPL sequence of indexes in the first place?
Well, this has been previously discussed before. The rationale is that I'd like to isolate common users from MPL as much as possible. Imagine the tutorial somehow pointed to the MPL reference for a forward compile-time sequence: IMHO, many readers would scare away. Which percentage of *users* of Boost are acquainted with such a complex library as MPL? MPL is an extremely powerful library, but I honestly don't expect it to to be part of the common knowledge shared by the C++ community.
I don't quite agree with you here... Meta-programming has become a major part of C++, and allowing to specify a list of types is going to be more and more common thing. It may be expected in the future by more and more people (as it is expected by some people already) that, whenever multiple types are used, they have to be combined in a standard type sequence. MPL sequence is becomming such standard (as STL has become). Besides, explaining how to combine types in an mpl::vector is quite trivial, and I don't see why it is more difficult than explaining the "indexed_by" template. One compromise would be to use the MPL sequence concept, and have indexed_by implementing it (say derive it from mpl::vector). At least then there would be no need in the MPL converter. Regards, Arkadiy