fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. struct MakePackable
  5. {
  6. };
  7.  
  8. struct A : MakePackable
  9. {
  10. int x1234;
  11. short x56;
  12. char x7;
  13. };
  14.  
  15. struct B : A
  16. {
  17. char x8;
  18. };
  19.  
  20. int main() {
  21. std::cout << sizeof(A) << ' ' << sizeof(B) << '\n';
  22.  
  23. std::cout << std::is_pod<A>::value << ' ' << std::is_pod<B>::value << '\n';
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
8 8
1 0