My friend told me that
auto x1 = {3}; // x1 is std::initializer_list<int>
auto x2{1, 2}; // error: not a single element
auto x3{3}; // x3 is int
I don't quite understand why auto x2{1, 2}; is illegal, can't it be deduced directly as std::initializer_list<int>?
Aucun commentaire:
Enregistrer un commentaire