以下程序...
#include <iostream>
#include <type_traits>
template <typename T>
struct Template{};
template <typename T>
using Alias = Template<T>;
template
<
template <typename>
class T1,
template <typename>
class T2
>
struct is_same_template : std::false_type{};
template
<
template <typename>
class T
>
struct is_same_template<T, T> : std::true_type{};
int main() {
std::cout << std::boolalpha;
std::cout << "Template == Template: " << is_same_template<Template, Template>::value << std::endl;
std::cout << "Template == Alias: " << is_same_template<Template, Alias>::value << std::endl;
std::cout << "Alias == Alias: " << is_same_template<Alias, Alias>::value << std::endl;
}
...输出...
Template == Template: true
Template == Alias: false
Alias == Alias: true
...用g++ 4.8.1,clang 3.4和vc++ 18.00.21005.1 编译。
这是这些编译器中的错误还是标准的要求?