[FYI] Forward movement on 9404

Paolo Carlini pcarlini@unitus.it
Sat Feb 22 10:28:00 GMT 2003


Nathan Myers wrote:

>Yes.  First, clean up the __testout tests:
>
>  if (__builtin_expect(!__testout, false))
>    return traits_type::eof();
>  if (__builtin_expect(__testeof, false))
>    return traits_type::not_eof();
>
>  __size_type __len = std::max(this->_M_buf_size, this->_M_buf_size_opt);
>  __len *= 2;
>
>  if (__builtin_expect(!__testwrite && __len > _M_string.max_size(), false))
>    return traits_type::eof();
>  if (!__testwrite)
>    {
>      // Force-allocate, re-sync
>      ...
>    }
>  return this->sputc(traits_type::to_char_type(__c));
>
Great! I'm incorporating this contribution of yours in the patch.

>But can we let the basic_string<> figure out a new length for itself,
>and allocate and copy, by calling capacity(__len)?
>
Indeed.
Especially so now that basic_string<> is able to grow exponentially.
Will try to look into this today and repost something closer to the
final version today or tomorrow.

Thanks,
Paolo.



More information about the Libstdc++ mailing list