Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-27 06:30:58

From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
> > Not necessarily. You can pass type2type<Typelist> around, which is the
> > preferable idiom since it works with any type, references, noncopyables,
> and
> > whatnot.
> Again, why do it the more complicated way if you can do it the simple way?

No particular reason, I just offered a workaround and stated some of its
benefits - that the idiom 'pass type2type<T> if you need the type but not
the value' works not only with typelists, but with any other type,
noncopyable, abstract, etc.

> I
> don't see any problem at all with letting typelists be instantiable, so
> bother?

I don't see a problem with that either. I simply speculated that it would be
intuitive for an instance of a typelist to be a tuple.

The other idea I tossed around - basing type lists and tuples on std::pair -
didn't seem to fly, either. But it, too, has some benefits. Some std::pair
operations generalize very well to pair-based tuples - like the existing
operator== and operator<. A 'political' argument in favor of std::pair is
that it would provide a 'common ground' for the Loki type list manipulation
library and Boost.Tuple.

Finally, I like the int2type<> and type2type<> names. They are sufficiently
obvious to me. I don't see a need to change them into *_identity.

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at