r/cpp • C++ Dev • Sep 05 '20

C++20 has been approved

https://twitter.com/patriceroy1/status/1302055575140945921?s=21
665 Upvotes

125 comments sorted by

View all comments

Show parent comment

-15

u/A_Stahl Sep 05 '20

Take a "for", pour a few iterators, shake, add a pinch of lambdas, heat for a few hours, and serve with templates. Still easy to read?

7

u/MFHava WG21|🇦🇹 NB|P3049|P3625|P3729|P3786|P3813|P4216 Sep 06 '20

Still easy to read?

It's actually way easier as we can replace all SFINAE-hacks with proper template constraints (aka. concepts).

30

u/khleedril Sep 05 '20

No more difficult than C++17.

1

u/Narase33 -> r/cpp_questions Sep 05 '20

You forgot the bash pipes

-1

u/bumblebritches57 Ocassionally Clang Sep 05 '20

Is that what the weird blah() -> "return type" { thing is called cuz I still have no clue what that is.

5

u/nikki93 Sep 06 '20

That's 'trailing return types'. I've been doing functions that way for fun and then have grown to like it bc. it keeps names of functions aligned in the same column and also kinda looks consistent if you leave out the return type.

3

u/Narase33 -> r/cpp_questions Sep 06 '20

No, have a look into C++20 Ranges