fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct t {
  6. int a;
  7. int b;
  8.  
  9. t (int t) : a(t), b(a + 1) {}
  10. };
  11.  
  12. int main() {
  13. auto a = t(41);
  14. cout << a.a << ' ' << a.b << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
41 42