This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Fw: Operator overloading in C++
- From: Sebastian Faubel <sebastian dot faubel at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 9 Apr 2008 00:25:56 +0200
- Subject: Fw: Operator overloading in C++
Begin forwarded message:
Date: Tue, 8 Apr 2008 01:30:40 +0200
From: Sebastian Faubel <s.faubel@web.de>
To: John Fine <johnsfine@verizon.net>
Subject: Re: Operator overloading in C++
hi john,
> I think you didn't show us the important part. I'm surprised that error
> message didn't tell you the type of u1 (or did you clip that as well?)
first, i did not clip anything except this line:
/home/.../unsigned.cpp: In function âint main()â:
which is in my opinion not really interesting..
> Without knowing how u1 was declared, I can't guess why you think u1+="
> "; has any connection to your class.
well, u1 is defined as follows:
rdf::ustring u1 = "Hello";
u1 += " ";
it's simply a instance of the rdf::unsigned_string class.. sorry that i forgot to metion that.
> Meanwhile, take another look it the method I quoted below from your
> post. Why do you think that is anything other than infinite recursion?
> (So once you fix your other errors, this one would still break the whole
> thing).
>
> Sebastian Faubel wrote:
> > unsigned_string& append(const unsigned_string& __s)
> > {
> > return append(__s);
> > }
thanks for the hint.. i may have noticed it by the time the program had compiled. i tried out
so many things the last weeks, it may have happend that this senseless stuff appeared by
some batch modification.
thank you!
~sebastian