I\'d like to have a C++0x static_assert that tests whether a given struct type is POD (to prevent other programmers from inadvertently breaking it with new members). ie,
C++0x introduces a type traits library in the header
for this sort of introspection, and there is an is_pod
type trait. I believe that you would use it in conjunction with static_assert
as follows:
static_assert(std::is_pod::value, "A must be a POD type.");
I'm using ISO draft N3092 for this, so there's a chance that this is out of date. I'll go look this up in the most recent draft to confirm it.
EDIT: According to the most recent draft (N3242) this is still valid. Looks like this is the way to do it!