Descopes: A missing compiler feature Posted by greglo on Tuesday June 06, 2017 @08:46PM from the medium.com dept. https://medium.com/@greglo/descopes-a-missing-compiler-feature-b4a5fa0751c8 ( 1 comment | 2 points | on HN )
C++11 has it, as long as your intermediate thing is not a parameter: auto real_var = []() { complicated lambda; return calculated_value; }();
I'm sure someone will figure out how to polyfill it into javascript ;-)