Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-26 08:46:46


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: <boost_at_[hidden]>

> Have you considered using std::pair as the 'dot pair' type? It doesn't
> really matter which template is used as long as it has two type
parameters -
> it doesn't even need a definition. std::pair is handy since it
automatically
> maps a value list (a tuple) to a typelist.
>
> Unless you need to pass _instances_ of typelists around, of course. Is
there
> such a need?

I'm guessing that will be needed to make things work on broken compiler(s).

>
> > namespace tl
> > {
> > template <class TList> struct no_duplicates;
>
> unique? remove_duplicates?
>
> > }
> >
> > * There is some controversy around the TYPELIST_nn macros. The best
> solution
> > uses an extralinguistic mechanism, which is sort of "cheating" but
sounds
> > pretty good. I believe that the one true solution is to change the
> language.
> > I am eager to hear suggestions and I would love it if the ensuing
> discussion
> > would lead to a good solution.
>
> Why did you reject the make_typelist<...>::type approach?

MPL uses a traits mechanism to make type_list<T1, T2, T3> equivalent to
cons<T1, cons<T2, cons<T3, null_type> > > as far as its algorithms are
concerned. What's wrong with that approach? It seems to be the best of all
worlds (currently possible in C++).

> A general comment about the library: there is significant overlap between
> the proposal, the existing tuple library and the upcoming mpl. I'd like to
> see this addressed - somehow.

Absolutely.

-Dave


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