dimanche 26 mai 2019

Why a named reference is an lvalue?

I know that a named refetence is an lvalue:

int x = 1;
int& ref1 = x;
int&& ref2 = std::move(x);

I've read the explanation - that is because we can rake the address of those ref1 and ref2.

But when we take the address of a reference we actually take the address of the referenced object, don't we? So this explanation doesn't seem to be correct.

So why a named reference is an lvalue?

Aucun commentaire:

Enregistrer un commentaire