James Kanze said:
only the value of an object is significant, not its identity.
Since I wrote »more precise« in my previous post, I need to
explain my problems with the above wording regarding »value
semantics«.
I am not sure what »the value of an object« versus »the
identity of an object« is, and what »significant« means here.
I believe that none of these notions is given by ISO/IEC
14882:2003(E).
Since an object is a typed region of storage, the »value of an
object« might be taken to be the state of this storage, thus,
»the value« is a composite value in the case of a class with
multiple fields. Such a thing might not be a »first-class
value« in C++, I believe it is represented by a so-called
»temporary object« when it is being transferred.
(Below, I choose to avoid the term »value« and use »==«
instead.)
»The identity of an object« might be read as »the address of
an object«.
»significant« might mean »able to change the observable
behavior of the program«.
Thus, the above possibly might be worded as:
The observable behavior of the evaluation of a function
call »f( o )« with a function »f« that has value-semantics
with regard to an argument object »o« will not change,
when the call is being replace by »f( o_ )«, given that
»o_« has the same type as »o« and »( o == o_ )« and that
»f( o_ )« is being evaluated with the same state of the
environment as »f( o )«.
This usually implies that the behavior of »f« does not
depend on the address of this argument.