conrad wrote:
In C, we have pass by value only.
This results from values being the
product of 'the value of the expression'.
Now, I imagine that the C++ standard
has the same concept of the
'value of the expression' but I wonder
what it yields in such a case when
passing a reference to a function
that expects a reference. Would it
perhaps be 'an object of the expression'?
Yes. If the result of the expression is an object, then
a reference can be bound to it and the reference argument
can be initialised from the object. To boot, there is
a way to create an object (from some expression result)
and pass it into a function that expects a reference to
a constant object. The language allows (or prescribes)
that in such a case a _temporary_ object will be created
and the reference will be bound to it.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask