fork(1) download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4.  
  5. struct Foo
  6. {
  7. int i;
  8. };
  9.  
  10. struct Bar : Foo
  11. {
  12. int j;
  13. };
  14.  
  15. int main()
  16. {
  17. cout << "Is Foo plain struct: " << (std::is_pod<Foo>::value ? "Yes" : "No") << std::endl;
  18. cout << "Is Bar plain struct: " << (std::is_pod<Bar>::value ? "Yes" : "No") << std::endl;
  19. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Is Foo plain struct: Yes
Is Bar plain struct: No