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