samedi 4 novembre 2017

Accepting return-by-value as const ref vs rvalue ref?

I know the knowledge is out there scattered among different questions but could someone help me to make a good listing for educational purposes and/or verify my ideas/wording?

Similarities:

  • both extend lifetime of returned object to the scope in which reference was defined

Differences:

  • all implication of constness: inability to modify lvalue reference

Aucun commentaire:

Enregistrer un commentaire