Re: A non-const reference may only be bound to an lvalue?



"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7790CF47-E70E-4079-A7C9-6F2C2FF528D8@xxxxxxxxxxxxx
Why,

That returned instance of B is not an lvalue - it's a temporary
rvalue.?

I think lvalue is something we can address and rvalue is something we
can not address. The reurn instance of B is a temporary object, I
think an object is addressable and should be lvalue?

No, it's not "addressable" and it's not an lvalue. Specifically, this
doesn't compile:

B* p = &( source() );

--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.