4 ms·
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 touc
by chubot 7y ago
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?lang=en 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...
- kllrnohj 7y ago> Braced initialization is crazy and I don't understand it It's a disambiguation thing: https://en.wikipedia.org/wiki/Most_vexing_parse 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#es23-prefer-the--initializer-syntax https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines...