This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
However, I agree that this cute solution has the potential to be the fastest oneThe best solution may be to use neither sbumpc() nor snextc(), but instead access the buffer directly, similar to what is already done in __copy_streambufs:
while (!_Traits::eq_int_type(__c, _Traits::eof())) { const size_t __n = __sbin->egptr() - __sbin->gptr(); if (__n > 1) { const char_type* p = traits_type::find(__sbin->gptr(), __n, __delim); if (p) __n = p - __sbin->gptr(); __str.append(__sbin->gptr(), __n); __sbin->gbump(__n);
In most cases, this should cause only a single call to append.
Thanks, Paolo.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |