This question already has an answer here:
const int& i = 5;
int& i = 5;
Why the 1st line is allowed but the 2nd line isn't? The explanation for the second may be that we can't assign a rvalue to a lvalue reference. Is it correct?
Aucun commentaire:
Enregistrer un commentaire