vendredi 27 mai 2016

Are C++ compilers allowed to replace construct + moveconstruct with just a construct?

Are C++ compilers allowed to replace:

const auto myType = MyType(1, 2, 3);

with:

const MyType myType(1, 2, 3);

ie, emit the assignment, or is there anything which prevents this?

Note: The reason I ask is that I prefer the first version.

Aucun commentaire:

Enregistrer un commentaire