If (&)references are alias of lvalue objects-variables then (&&)references are alias of what? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

If (&)references are alias of lvalue objects-variables then (&&)references are alias of what?

References have no space in memory but they 'share' the same as their object. So If I did: MyClass* obj=new MyClass(); MyClass& ref = *obj; The ref would have the same adress as obj. However in this example: std::string first= "Hello "; std::string second="World!"; std::string&& ref= first+second; What is the memory of ref?

2nd Apr 2020, 3:06 PM
xaralampis_
xaralampis_ - avatar
0 Réponse