fork download
  1. #include <functional>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. auto a = 0, b = 1, c = 2;
  9.  
  10. for(auto& i : {ref(a), ref(b), ref(c)}) i += 10;
  11.  
  12. cout << a << endl << b << endl << c << endl;
  13. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
10
11
12