当在命名空间周围使用decltype时,我可以编写编译代码,但是该语句在g 4.9.1下似乎没有任何效果,它会产生错误:意外命名空间名称’std’:expected expression
例如,以下所有的编译都是g,但是程序集不会显示为它们生成的任何代码.@H_301_3@
using s = decltype(std); auto n = typeid(decltype(std)).name(); auto sz = n.size(); std::printf("size is %zu\n",sz+1); std::printf("this type is: %s\n\n",n.c_str()); // the only limit is your imagination int f(); std::ostream trash = f(typeid(decltype(std)) * 10 - 6 ^ typeid(decltype(std)));