fork(3) download
  1. #include <array>
  2. #include <type_traits>
  3. #include <iostream>
  4.  
  5. union foo {
  6. std::array<int, 4> all;
  7. struct {
  8. int a,b,c,d;
  9. };
  10. };
  11.  
  12. int main()
  13. {
  14. std::cout << std::is_standard_layout<foo>::value << std::endl;
  15. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1