On Wednesday, November 28, 2001, at 12:32 PM, James S. Adelman wrote:
Nonetheless, two symbols are equal only if one can be used in place of
another. This is clearly not the case for int2type, since it maps an
int to
a type, and it is not the case for type2type, since the types are
distinct.
wrt int2type, agreed.
You're still not looking at type2type the way I am. Adrei's type2type
is defined thus:
Baskerville0000,0000,9999
template <
struct Type2Type
{
typedef T OriginalType;
};
If you regard Type2Type as a metafunction, then T
is its parameter and OriginalType is its return value, in which case
it is a true identity function.
I realize that that isn't the purpose for which these templates are
defined in Andrei's code. They really are wrappers, in general used to
prevent some properties of their parameters from coming into play
(e.g. a reference type or a compile-time constant integer can be
wrapped into a value type), so that types and objects can be treated
with more uniformity.