News for hackers. Stuff that matters.
Re:Proving that C++'s grammar is undecidable by chubot on Tuesday April 28, 2020 @11:54PM (#23015162)
What bugs me is that you don't even need to use templates to run into syntax traps. Braced initialization is crazy and I don't understand it (having first touched C++ sometime in the 90's, done it professionally, and even writing in my own pidgin subset now)

https://twitter.com/timur_audio/status/1119160309573242880?l...

I can understand having crazy syntax for rare and exotic things. But variable initialization is not one of those things...

Re:Proving that C++'s grammar is undecidable by kllrnohj on Wednesday April 29, 2020 @01:03AM (#23015560)
> Braced initialization is crazy and I don't understand it

It's a disambiguation thing: https://en.wikipedia.org/wiki/Most_vexing_parse

The simple recommendation is to just always use {} when you want to construct an object, see https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines...

Re:Proving that C++'s grammar is undecidable by saagarjha on Wednesday April 29, 2020 @01:52AM (#23015836)
Unfortunately it’s not perfect and can do strange or undesirable things sometimes, especially when interacting with auto.
Re:Proving that C++'s grammar is undecidable by kllrnohj on Wednesday April 29, 2020 @11:56AM (#23020692)
C++17 improved the auto situation. It looks pretty much as I'd expect now.