Hacker News new | past | comments | ask | show | jobs | submit login

The latest revision to the C++ standard, including polymorphic lambdas, makes the xplusone definition much terser:

    auto xplusone = [](auto x){ return x + 1; };
While at it, here's how Paul Graham's accumulator generator looks in C++14:

    auto foo = [](auto n){ return [=](auto i) mutable { return n += i; }; };
This does not affect the point of the article in any major way; just a curiosity.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: