Basic string bug
Jonathan H Lundquist
jhl@sssonline.com
Thu Sep 30 13:09:00 GMT 1999
Gawain is correct of course, must have been brain fade :)
-----Original Message-----
From: Gawain Bolton [ mailto:gbolton@club-internet.fr ]
Sent: Thursday, September 30, 1999 1:00 PM
To: Jonathan H Lundquist
Cc: 'libstdc++@sourceware.cygnus.com'
Subject: Re: Basic string bug
Jonathan H Lundquist wrote:
> else if (__n < __size)
> this->erase(__n);
> // else nothing (in particular, avoid calling _M_mutate()
> unnecessarily.)
> }
>
> I believe this->erase(__n) should be erase(ibegin() + n, iend())
I admit the code looks a bit strange, but I believe it is correct... In
effect the function being called is:
erase(size_type pos = 0, size_type n = npos);
...
More information about the Libstdc++
mailing list