Andre Poenitz wrote:
> On Mon, Sep 11, 2006 at 08:57:13AM +0200, Georg Baum wrote:
>> Lars Gullik Bjønnes wrote:
>>
>> > You should probably do operator+= as well. But I am not sure if that
>> > is possible as a out-of-class operator.
>>
>> It is not, otherwise I would have done it. We can of course make
>> docstring a subclass of std::basic_string<boost:unit32_t> and add it
>> ourselves, but then we need to forward many constructors.
>
> Nonsense.
>
> struct A { };
> void operator+=(A &, int) {}
> int main() { A a; a += 1; }
>
> should compile just fine.
Then you can explain to me why operator+= is a class member of std:string? I
don't want to add an out-of-class opertaor+= without knowing why the
existing ones are members.
Georg