c++2018. 6. 29. 16:51


 

[] : 아무것도 캡처하지 않음

[&x]: x만 Capture by reference 

[x] : x만 Capture by value

[&] : 모든 외부 변수를 Capture by reference

[=] : 모든 외부 변수를 Capture by value

[x,y] : x,y 를 Capture by value

[&x,y] : x는 Capture by reference , y는 Capture by value

[&x, &y] : x,y 를 Capture by reference

[&, y] : y 를 제외한 모든 값을 Capture by reference

[=, &x] : x 를 제외한 모든 값을 Capture by value

한글 설명:

 

http://vallista.tistory.com/entry/C-11-Lambda-Expression-%EB%9E%8C%EB%8B%A4-%ED%91%9C%ED%98%84%EC%8B%9D-%ED%95%A8%EC%88%98-%EA%B0%9D%EC%B2%B4-Functor

 

 

'c++' 카테고리의 다른 글

map vs unorderedmap 성능 차이  (0) 2022.11.02
Asan test  (0) 2022.10.29
undef 활용, log message 출력  (0) 2019.10.02
Posted by easy16