fork download
  1. #include <array>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. void foo(const char* val) {
  6. std::cout << val << std::endl;
  7. }
  8.  
  9. class A { public:
  10. int a;
  11. int b;
  12. int c;
  13. A() : c((foo("c"),1))
  14. , b((foo("b"),2))
  15. , a((foo("a"),2))
  16. {}
  17. };
  18.  
  19.  
  20. int main() {
  21. A a;
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 4568KB
stdin
Standard input is empty
stdout
a
b
c