Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2001-11-28 15:15:53

From: "David Abrahams" <david.abrahams_at_[hidden]>

> FWIW, I'm back to liking int_wrapper and type_wrapper ;-/.

I certainly agree that we need an identity metafunction so I
like that name for the template when it is being used in that
role. However the same template can be used for other things
as demonstrated by Andrei, and for this identity is probably
not appropriate.

But I certainly don't like type2type either. "Converts each
type into a unique, insipid type" is pretty meaningless to me.
What is an insipid type? Why do we need to "convert" the type
to another type - it's already a type.

type_wrapper is definitely a better choice, so we could either
do this:

    template <typename T>
    struct type_wrapper
        typedef T type;

    template <typename T>
    struct identity : type_wrapper<T> {};

or just duplicate the code since it is so simple.

As far as int2type is concerned, I agree with Aleksey's
arguments in favour of brevity and think int_t is best.


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