This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Basic string bug
- To: "'libstdc++ at sourceware dot cygnus dot com'" <libstdc++ at sourceware dot cygnus dot com>
- Subject: Basic string bug
- From: Jonathan H Lundquist <jhl at sssonline dot com>
- Date: Wed, 29 Sep 1999 10:47:13 -0700
string.tcc contains the following:
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT
__c)
{
__LENGTHERROR(__n > max_size());
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
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())