3 ms·
That's a C99 feature, designated initializer. Hardly modern. Yes it was ported to C++ relatively late, but it happened in C++20.
by kccqzy 4mo ago
That's a C99 feature, designated initializer. Hardly modern. Yes it was ported to C++ relatively late, but it happened in C++20.
- manwe150 4mo agoWouldn’t c99 also make you name the type there (looking sort of like a cast), further straying from being just kwargs? I thought this was a c++ deduction feature for it to bind the initializer to whether method could take that list
- rwmj 4mo agoDon't C++ designated initializers require you to initialize in struct order? That makes them kind of annoying to use.
- greenbit 4mo agoIMO it renders them kind of pointless, as you can then just leave out the field names (keywords, in pythonese) and get the same effect. It's very disappointing that they're naught but comments without the punctuation.
- ozgrakkurt 4mo agoYou can disable the lint for this if you don’t use constructors/destructors in your project or if you are sure you won’t do funky stuff in the struct initializer afaik