fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Thing {
  5. Thing(const int a) : a(a) {};
  6. int a = -1;
  7. void set_a(const int a) { this->a = a; };
  8. };
  9.  
  10. void strange(Thing& t) {
  11. t.set_a(-1), 2, t.set_a(3); // <-- ?
  12. }
  13.  
  14. int main() {
  15. Thing t(3);
  16. strange(t);
  17. std::cout << t.a;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4524KB
stdin
Standard input is empty
stdout
3