6
考虑下面的代码片断:匿名临时变量和类模板参数推导 - 的gcc VS铛
template <typename T>
struct foo
{
foo(T) { }
};
int main()
{
foo{0};
}
克++ 7愉快地创建foo
类型的临时对象,推导T = int
。
铛++ 5和6拒绝编译的代码:
error: expected unqualified-id foo{0}; ^
这是一个铛错误,或者是有一些在标准防止类模板参数扣除从踢入未命名的临时文件ES?