【发布时间】:2011-11-02 10:27:44
【问题描述】:
这个结构是 C++11 中的 POD 吗?
struct B
{
int a;
B(int aa) : a(aa) {}
B() = default;
};
请注意,这个问题是关于 C++11 的。我知道这个类不是 C++98 和 C++03 中的 POD。
有关 C++11 中 POD 的解释,请参阅trivial vs. standard layout vs. POD
(受此问题启发:Is there a compile-time func/macro to determine if a C++0x struct is POD?)
【问题讨论】:
-
...你指的是什么类?
-
老实说,如果您看到有关
std::is_pod的问题,您为什么不向编译器提出这个问题? -
@R. Martinho Fernandes VS2010 不接受“=default”,Comeau 在线编译器也不接受。