T
Taras_96
On Dec 13, 6:30 pm, Taras_96 <[email protected]> wrote:
A more interesting case would be:
Foo f() ;
Foo b = f() ;
Here, the rvalue is used to initialize the reference
parameter---in other words, it is behaving like an lvalue, or is
immediately converted to an lvalue (depending on how you want to
word it---but a reference is an lvalue, no matter how you look
at it).
Good points . This is of course assuming that the c cstrctr takes a
reference, rather than a constant reference (otherwise there wouldn't
be need for the conversion to an l-value, as an r-value can be used to
initialise a constant reference).
The above, except that you don't even need to call a member
function. Otherwise, of course, the classical:
std:stringstream().flush() << ...
std:stringstream() is, of course, not an lvalue. But flush()
returns a reference to it, and a reference is an lvalue.
Also true