2 ms·
C# has inner (local) functions which are close in semantics to lambdas but have names. I didn’t think I’d use them at first, but actually I use them all the tim
by moomin 6y ago
C# has inner (local) functions which are close in semantics to lambdas but have names. I didn’t think I’d use them at first, but actually I use them all the time and often prefer them to raw lambdas.
- zelly 6y ago#include <cstdio> int main() { auto square = [](double x) -> double { return x*x; }; printf("%f\n", square(10)); return 0; } since 2011