Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-10-14 01:53:11


>From: "Gabriel Dos Reis" <gdr_at_[hidden]>

>Terje Slettebø <tslettebo_at_[hidden]> writes:

>| >From: "Daniel Frey" <daniel.frey_at_[hidden]>
>|
>| >>Gabriel Dos Reis wrote:
>| >>
>| >> | To me, it is something that I can read.
>| >>
>| >> Interesting. So you can read a reference. How?
>|
>| >I knew it was going in the wrong direction :) I mean the sematic of
>| >"value" against the semantic of "object". I don't refer to the standard
>| >here, but to the meaning of these words in the natural language (of a
>| >C++ programmer :).
>|
>| I think the discussion could be clearer if "lvalue" or "rvalue" is used,
>| instead of "value" and "object". An object is a value. See e.g. 3.10,
>| "Lvalues and rvalues".

>Note however that the definitions found in 3.10 aren't really helpful
>in distinguishing lvalues from rvalues. Just look at the footnote to get
>some feeling :-)

I know. :) I've seen a long discussion of lvalue and rvalue, earlier.
However, I thought it could be a more useful distinction than "value" and
"object". 42 is also a literal, as has been pointed out.

>I think the whole thing would have been clearer if the notion of
>lvalue were refelected at the type-system level.

>| >> | It's different from an "object", which is something you can change.
>|
>| >An example: 42 is a value.
>|
>| Yes, an rvalue.
>|
>| >An 'int' which holds the value 42 is an
>| >"object", as you can modify it.
>|
>| And that's an lvalue.

>That is not clear: int(42) designates an object; and at the same time,
>it is an rvalue (according to the standard).

Yes. I took "int" here to mean an int variable.

Regards,

Terje


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk