3 ms·
C++14 improves upon lambda captures a lot. I'm also not aware of a move capture, only "by reference" (&) and "copy" (=). In C++14 you're allowed to put arbitrar
by lorenzhs 10y ago
C++14 improves upon lambda captures a lot. I'm also not aware of a move capture, only "by reference" (&) and "copy" (=). In C++14 you're allowed to put arbitrary assignments into the capture, e.g.
[foo=std::move(bar)]() {}
- beached_whale 10y agoI did that in the C++11 days by creating a bastard class template that would subvert the copy operator and turn it into a move and capture that by value. It was ugly as heck and was removed as soon as I have c++14