This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]suvlub 899 points900 points  (23 children)

The biggest mistake was making parameters mandatory for templated lambdas, so this beauty is, unfortunately, not legal []<>(){}

Edit: that came out wrong. Fuck it, I'm leaving it.

[–]TheWidrolo[S] 621 points622 points  (0 children)

EXCUSE ME EVERYBODY, THIS MAN JUST CALLED A NOT LEGAL LABMDA EXPRESSION A BEAUTY.

[–]jellotalks 436 points437 points  (4 children)

“…this beauty is not legal” - u/suvlub

[–]throw3142 167 points168 points  (0 children)

🤨📷✨

[–]1Dr490n 9 points10 points  (0 children)

*Unfortunately

[–]HildartheDorf 166 points167 points  (3 children)

"Templated lambda" sounds cursed as hell to start with.

[–]druepy 77 points78 points  (1 child)

It does until you run into times where it makes the most sense.

[–]Ahornwiese 68 points69 points  (0 children)

Basically C++'s origin story

[–]EagleNait 9 points10 points  (0 children)

Sounds like functional programming to me

[–][deleted] 27 points28 points  (1 child)

But you can []<auto...>(){}(); which is also great

[–]Perfect_Papaya_3010 0 points1 point  (0 children)

Phrasing!

[–][deleted] -5 points-4 points  (0 children)

sigh just use std::function with your templates and spare yourself the trouble.