3 ms·
C++14 standard: auto add = [](auto x) { return [x](auto y) { return x + y; }; }; auto addFive = add(5); auto result = addFive(3);
by mackman 3y ago
C++14 standard:
auto add = [](auto x) { return [x](auto y) { return x + y; }; };
auto addFive = add(5);
auto result = addFive(3);
- mathisfun123 3y agoThis isn't currying at all because each call to add builds a completely new (internal) representation of the addition function.