This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54606] reference assignment failing/points at previous object


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54606

--- Comment #3 from Troy <gcc at gyw dot com> 2012-09-25 09:13:34 UTC ---
I think more to the point, and a better mnemonic, is to say that "there are no
references in C++." What is called a reference in C++ is really just a
rename/alias for the variable. To reiterate my point, if assignment to a
"reference" is equivalent to assigning to the original variable, then we are
talking a rename operation similar to a C macro, not the creation of a new
"reference object." Sadly, I found out that I had fallen into the same trap
before as well, just forgot about it. So clearly there is need for a mnemonic.
Maybe not for people who only use C++, but for the rest of us who have to use
multiple languages, including variants of C++ such as C++/CLI, the word
"reference" in the C++ context really stinks. It is one of the Norman doors (UX
term) of C++, as it keeps making people push the wrong side of the door time
and again.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]