Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
结果和decltype模板标识符一样吗?(当提到 T 及其值时,正确的术语是什么?)。那就是断言失败的情况?
decltype
template<typename T> void foo(T x) { static_assert(std::is_same<decltype(x), T>::value, "decltype check failed"); }
变量的类型x是 T,因此 static_assert 总是会通过。
x