#include <iostream>
struct A {
const int test_;
};
static_assert(std::is_pod<A>::value, "must be POD type");
int main()
{
std::cout<<"Hello World";
return 0;
}
Run Code Online (Sandbox Code Playgroud)
在 Clang 和 GCC 上std::is_pod<A>::value是true,而在 ICC 和 MSVC 上是false。
Ifconst int test_;被替换为int test_;or const int* test_then 它也会传递 ICC 和 MSVC。
标准怎么说?
| 归档时间: |
|
| 查看次数: |
113 次 |
| 最近记录: |