mercredi 28 janvier 2015

c++11 initialization T{p, ...} vs T = {p, ...} [duplicate]


In his new book Effective Modern C++, Scott Meyers makes the statement in the section "Items 7: Distinguish between () and {} when creating objects," that:



I'll generally ignore the equals-sign-plus-braces syntax, because C++ usually treats it the same as the braces-only version.



Taking note of the "usually" qualifier, how does when and how does = { ... } differ from plain { ... }?


Aucun commentaire:

Enregistrer un commentaire