I've seen code like
struct A { int m; }; vector<A> vec; vec.push_back({});
My question is: What's the difference between vec.push_back({}); and vec.push_back(A{})? Why can we omit A in A{}?
vec.push_back({});
vec.push_back(A{})
A
A{}
Aucun commentaire:
Enregistrer un commentaire