fork download
  1. #include <iostream>
  2.  
  3. struct foo {
  4. static constexpr int32_t kTrackDefault = -2;
  5. int32_t a = 0;
  6. int32_t b = kTrackDefault;
  7. };
  8.  
  9. int main()
  10. {
  11. auto bar = foo();
  12. auto baz = foo({.a = 10, .b = 20});
  13.  
  14. std::cout << bar.a << " "<< bar.b << std::endl;
  15. std::cout << baz.a << " "<< baz.b << std::endl;
  16. std::cout << foo::kTrackDefault << std::endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5260KB
stdin
Standard input is empty
stdout
0 -2
10 20
-2