hackingcpp / comments

Comments regarding hackingcpp.com
0 stars 0 forks source link

cpp/lang/lambda_basics #42

Open utterances-bot opened 8 months ago

utterances-bot commented 8 months ago

C++ Lambdas Introduction | hacking C++

A short introduction to C++'s auto-generated function classes known as lambdas.

https://hackingcpp.com/cpp/lang/lambda_basics.html

blakeb211 commented 8 months ago

From my experiment, is it true that we can only move a new variable into a closure, but cannot write its type out explicitly and cannot simply create a new variable, e.g. cannot do [int c = std::move(x)] () { ... } or [int c] () { ... } ?