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]

Re: [PATCH 3/4] libstdc++: avoid character accumulation in istreambuf_iterator


Hi,

On 15/11/2017 11:48, Petr Ovtchenkov wrote:
Ask associated streambuf for character when needed instead of
accumulate it in istreambuf_iterator object.

Benefits from this:
   - minus one class member in istreambuf_iterator
   - trivial synchronization of states of istreambuf_iterator
     and associated streambuf
---
  libstdc++-v3/include/bits/streambuf_iterator.h | 34 ++++++++++++--------------
  1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index 08fb13b..203da9d 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -95,19 +95,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        // NB: This implementation assumes the "end of stream" value
        // is EOF, or -1.
        mutable streambuf_type*	_M_sbuf;
-      mutable int_type		_M_c;
Obviously this would be an ABI-breaking change, which certainly we don't want. Unless I missed a detailed discussion of the non-trivial way to avoid it in one of the recent threads about these topics...

Paolo.


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