Try this to access by copy

PHOTO EMBED

Sat Nov 07 2020 03:20:33 GMT+0000 (UTC)

Saved by @teofre #c++

// access v1 by copy 
[v1]() { 
	for (auto p = v1.begin(); p != v1.end(); p++) { 
		cout << *p << " "; 
	} 
}; 
content_copyCOPY

https://www.geeksforgeeks.org/lambda-expression-in-c/