Make istreambuf_iterator::_M_sbuf immutable and add debug checks

François Dumont frs.dumont@gmail.com
Fri Oct 13 17:14:00 GMT 2017


Hi

      Here is the last patch I will propose for istreambuf_iterator. 
This is mostly to remove the mutable keyword on _M_sbuf.

      To do so I had to reset _M_sbuf in valid places that is to say 
constructors and increment operators. Despite that we might still have 
eof iterators with _M_sbuf not null when you have for instance several 
iterator instance but only increment one. It seems fine to me because 
even in this case iterator will still be considered as eof and using 
several istreambuf_iterator to go through a given streambuf is not usual.

      As _M_sbuf is immutable I have been able to restore the simple 
call to _M_at_eof() in the increment operators debug check.

Ok to commit after successful tests ?

François



-------------- next part --------------
A non-text attachment was scrubbed...
Name: immutable_streambuf_ite.patch
Type: text/x-patch
Size: 5861 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20171013/fc778296/attachment.bin>


More information about the Libstdc++ mailing list