fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. size_t i = 0;
  5. vector<int> v = {1,2,3};
  6. int main()
  7. {
  8. [i,v]() mutable {i = v.size();}();
  9. cout << i << endl;
  10.  
  11. return EXIT_SUCCESS;
  12. }
  13.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
3