fork download
  1. #include <type_traits>
  2. #include <iostream>
  3.  
  4. struct Foo {
  5. Foo() : x(0), y(0) {}
  6. int x;
  7. int y;
  8. };
  9.  
  10. struct Bar {
  11. Bar() = default;
  12. int x;
  13. int y;
  14. };
  15.  
  16. int main()
  17. {
  18. if (std::is_pod<Foo>::value) std::cout << "Foo is a POD" << std::endl;
  19. else std::cout << "Foo is *not* a POD" << std::endl;
  20.  
  21. if (std::is_pod<Bar>::value) std::cout << "Bar is a POD" << std::endl;
  22. else std::cout << "Bar is *not* a POD" << std::endl;
  23. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
Foo is *not* a POD
Bar is a POD