C++11 Miniseries: Lambda Functions

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

One of the best explanations i've heard of how lambdas are represented internally!
To revisit the capture clause section for a moment please note the following: You can capture by value or by ref (or both) in the same clause. If use the variable name (or multiple w/ commas) you will capture by VALUE, e.g [myvar, myvar2], you can also capture a variable by ref using the ampersand e.g. [&myvar]. Alternatively you can use an equal [=] or [&] to capture ALL variables in local scope. Or a combination [&, myvar, myvar2] <---which means "default capture by reference except for myvar and myvar2".

jd.