3 ms·
Ok. auto i{42}; // std::initializer_list<int>
by thecpphorse 10y ago
Ok.
auto i{42}; // std::initializer_list<int>
- david-given 10y agoBut why is that bad?
- lmitchell 10y agoBecause `i` isn't an int, it's an initializer_list, and you almost never want to actually create an initializer_list instead of an int? Seems pretty understandable to me.
- thecpphorse 10y agoIt's unexpected. Nobody ever* wanted to assign an initializer list to a named variable. [*] pretty much
- hellofunk 10y agoNo longer applies with c++17