The example posted is a horrible use of autocomplete.
>const int calculated = [&] { auto l = lock(); auto first = stage1(); auto second = stage2(); return combine(first, second); }()
No idea what that does. It takes 2 variables of some type and does something too them. There is some sort of lock there too. I guess.
Clearly that was an example created to demonstrate the lambda idiom, it wasnt real code
return combine( stage1(), stage2() )
The problem here is poorly written code. I shouldn't need an IDE to tell me what is going on, the code should do it.
The example posted is a horrible use of autocomplete.
>const int calculated = [&] { auto l = lock(); auto first = stage1(); auto second = stage2(); return combine(first, second); }()
No idea what that does. It takes 2 variables of some type and does something too them. There is some sort of lock there too. I guess.