non-const reference to temporary (was: non-const copy ctor)

Christian Fröbel cfroebel@web.de
Mon Apr 10 09:46:00 GMT 2006


Hi Andrew,

> [...]
> C++ doesn't have any stack, and it doesn't have any registers.  By
> thinking "under the hood" in this way you're confusing implementation
> with langauge in an unhelpful way.  All that matters is how the
> language is *defined*.  I suspect this unnecessary mixing of levels is
> responsible for much of the confusion in this thread.

Good point, I guess you're right.

> [...]
> The reason non-const references to non-lvalues is not allowed is
> explained in Section 3.7 of "The Design and Evolution of C++".

I'll have a look at that soon (when I have this book).

Thanks,
  Christian

> [...]



More information about the Gcc-help mailing list