Re:Functional programming in C++ (2012)
by jimbob45 on Monday December 28, 2020 @06:42PM
(#25564712)
I thought about lambdas before I wrote my answer but I thought decltype was and is more conventionally used for that purpose?
[ Parent
| on HN ]
Re:Functional programming in C++ (2012)
by MauranKilom on Monday December 28, 2020 @07:21PM
(#25565042)
Can you elaborate what you envision there? For reference, a lambda in C++ might look like this:
auto sqr = [](double val) { return val * val; };
(The lambda expression is technically only the part after the =, but storing it into a variable is common enough).How would you use decltype here?