3 ms·
C++ has this[1], kind of, but please don't actually use it. > for_each(a.begin(), a.end(), std::cout << _1 << ' '); Also, Scala has something similar as a fir
by GrantMoyer 1y ago
C++ has this[1], kind of, but please don't actually use it.
> for_each(a.begin(), a.end(), std::cout << _1 << ' ');
Also, Scala has something similar as a first class feature[2].
[1]: https://www.boost.org/doc/libs/1_88_0/doc/html/lambda.html https://www.boost.org/doc/libs/1_88_0/doc/html/lambda.html
[2]: https://scala-lang.org/files/archive/spec/3.4/06-expressions.html#placeholder-syntax-for-anonymous-functions https://scala-lang.org/files/archive/spec/3.4/06-expressions...