This question already has an answer here:
- Why does the standard differentiate between direct-list-initialization and copy-list-initialization? 1 answer
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