This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: return "" in bastring.h ?


> It's probably a known problem that the following code in std/bastring.h
> gives quite some problems when using different charT's than char.

Thanks for your bug report. I don't know if it is a known problem, but
it is unlikely to be fixed in libstdc++ v2. Please have a look at
libstdc++ v3, which implements c_str as

      const _CharT* 
      c_str() const
      {
	// MT: This assumes concurrent writes are OK.
	size_type __n = this->size();
	traits_type::assign(_M_data()[__n], _Rep::_S_terminal);
        return _M_data();
      }

using a totally different string class, of course.

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]