3 ms·
I really don't see how that is so much better than the alternative that it would warrant a language change: int square(int num) { auto nested = [&num](){
by cheez 6y ago
I really don't see how that is so much better than the alternative that it would warrant a language change:
int square(int num) {
auto nested = [&num](){
num *= num;
};
nested(num);
return num;
}
- rightbyte 6y agoI agree, given the fact that lambdas are already here.
- cmeacham98 6y agoSlight mistake: should be auto nested = [](int& num){ (or switch calling nested to have no params)
- cheez 6y agoThe HN C++ compiler ;-)