[Bug c++/32944] operator= not ambiguous overload but does not compile
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Aug 1 00:24:00 GMT 2007
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-08-01 00:24 -------
You need to change the operator= to:
CString& operator=(const CString& newValue){
Otherwise you cannot bind a rvalue to the reference as it will only bind to a
lvalue and returned from operator+ is a rvalue.
In C++0x there are rvalue references which you can use but that feature is not
in a released version of GCC yet. (it is on the trunk though).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32944
More information about the Gcc-bugs
mailing list