Answer by Konstantin Burlachenko for Test for "POD-ness" in c++/c++11?
There is exist a method to call std::tr1::is_podAlso you can use bycicle like:#define CHECK_TYPE_IS_A_POD(TYPE)\{\ switch(1)\ {\ case 1:\ TYPE IF_COMPILE_ERROR_THEN__##TYPE##__IS_NOT_A_POD;\ /* prune...
View ArticleAnswer by Oktalist for Test for "POD-ness" in c++/c++11?
The standard (C++98) says that only types with C-like construction/destruction semantics can be members of a union. That covers most of the things that would make a type non-POD, so just define a union...
View ArticleAnswer by Steve Jessop for Test for "POD-ness" in c++/c++11?
std::is_pod<A>::value in C++11.[Edit: refer to Luc's comment above, in C++11 you don't need the type to be POD for what you're doing.For that matter you also don't need to cast to void*, and...
View ArticleTest for "POD-ness" in c++/c++11?
I have some code which takes a packed POD structure/class and copies it into a memory block.struct A{ int a; int b;} a;memcpy(mymemoryblock, (void *)&a, sizeof(A));// later I get a reply...
View Article