const __size_type __len = std::min(__opt_len, __max_size);
__string_type __tmp;
__tmp.reserve(__len);
- __tmp.assign(_M_string.data(), this->epptr() - this->pbase());
+ if (this->pbase())
+ __tmp.assign(this->pbase(), this->epptr() - this->pbase());
_M_string.swap(__tmp);
_M_sync(const_cast<char_type*>(_M_string.data()),
this->gptr() - this->eback(), this->pptr() - this->pbase());
this->gbump((__beg + __pos) - this->gptr());
if (__testout)
this->pbump((__beg + __pos) - this->pptr());
- __ret = pos_type(off_type(__pos));
+ __ret = __sp;
}
}
return __ret;