Let's consider a set of template aliases:
template<class T> using foo = T*;
template<class T> using bar = T*;
template<class T> using buz = foo<T>;
template< template<class>class TT > struct id {};
using id_foo = id<foo>;
using id_bar = id<bar>;
using id_buz = id<buz>;
Are id_foo
, id_bar
, id_buz
same or different types? Are foo
, bar
, buz
same or different templates?
Various compilers have different opinions on that. Particularly,
- MSVC 2015 and clang 3.5 treat they all are different
- gcc 4.9 treats
buz
is same asfoo
Standard C++11 in the chapter 14.5.7 "Alias templates" is unclear.
An alias template is a template which, when specialized, is equivalent to the result of substituting the template arguments of the alias template for the template parameters in the type-id
– Provincialism