Hi,
If we want a statement to return an lvalue, in C++, you need to use
"by-reference".
I still can't visualize what is meant by lvalue
T i; < this is an lvalue object?
j = i < i and j are both lvalues?
Am i correct?
Thanks

Re: lvalue question by Igor

Igor
Thu Feb 22 07:05:54 CST 2007

"Jacky" <jl@knight.com> wrote in message
news:e1OLPsnVHHA.1636@TK2MSFTNGP02.phx.gbl
> I still can't visualize what is meant by lvalue

Roughly, if it can occur on the left hand side of an assignment, it's an
lvalue. If it occupies storage so that you can take its address, it's an
lvalue.

> T i; < this is an lvalue object?

Yes. You can write &i

> j = i < i and j are both lvalues?

j is undeclared identifier. i is still an lvalue. It doesn't matter that
in this particular case it appears on the right of an assignment. What
matters is that it could potentially be on the left side. But I find it
easier to think about it in terms of address-of & operator.
--
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