[temp.type] (original) (raw)

13 Templates [temp]

13.6 Type equivalence [temp.type]

Two values are template-argument-equivalent if they are of the same type and

[Example 1:

template<class E, int size> class buffer { }; buffer<char,2*512> x; buffer<char,1024> y;declaresxandyto be of the same type, andtemplate<class T, void(*err_fct)()> class list { }; list<int,&error_handler1> x1; list<int,&error_handler2> x2; list<int,&error_handler2> x3; list<char,&error_handler2> x4;declaresx2andx3to be of the same type.

Their type differs from the types ofx1andx4.

template<class T> struct X { };template<class> struct Y { };template<class T> using Z = Y<T>; X<Y<int> > y; X<Z<int> > z;declares y and z to be of the same type.

— _end example_]

If an expression e is type-dependent,decltype(e)denotes a unique dependent type.

[Note 1:

However, such a type might be aliased, e.g., by a typedef-name.

— _end note_]

Otherwise, two such pack-index-specifiers refer to the same type only if their indexes have the same value.