mercredi 13 juillet 2016

Does binding a reference actually evaluate the operand?


Consider this code:

int& x=*new int;

Does RHS of the assignment actually dereference the newly-created pointer, leading to UB due to reading uninitialized variable? Or can this be legitimately used to later assign a value like x=5;?


Aucun commentaire:

Enregistrer un commentaire