Boost logo

Boost :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2004-04-16 09:31:50


Arkadiy Vertleyb <vertleyb <at> hotmail.com> writes:
>
> "Joaquín Mª López Muñoz" <joaquin <at> tid.es> wrote
>
> >> Why not use an MPL sequence of indexes in the first place?
[...]
> >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).

Well, our opinions differ. Just out of curiosity, ask
your fellow programmers if they know what MPL is. I have
done that, and hardly anyone knew about Boost, let alone MPL.
Anyway, please read on.

[...]
> 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.
>

I've done some tweakings and your proposal works.
Besides, it makes sense. To sum it up, one would
still be allowed to write

multi_index_container
<
  employee
  indexed_by<
    ...
>
>

*and* also

multi_index_container
<
  employee
  mpl::vector<
    ...
>
>

or whatever MPL forward sequence. OK, it seems to me
a good compromise. If nobody's against it it'll go in
the post review version. Thanx for discussing!

Joaquín M López Muñoz
Telefónica, Investigacón y Desarrollo


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