Repository navigation
Conversation
fix post-decrement off-by-one in range_adapter_impl<forward_iterator_tag>::read which returned n + 1 when characters remained in the range, causing stream buffer corruption. fix write which mutated n and returned -1 or 0 instead of characters written. add tests covering forward iterator ranges. fixes boostorg#191
aouxwoux
force-pushed
the
fix-range-adapter-forward-iterators
branch
from
October 25, 2026 17:17
94f988a to
ada43c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #191
what changed
ange_adapter_implstd::forward_iterator_tag::read, count consumed elements explicitly instead of post-decrementing
em. when characters remained in the range, the post-decrement in while (cur != last && rem-- > 0) evaluated when
em == 0, decrementing
em to -1 and returning
ange_adapter_implstd::forward_iterator_tag::write, count written elements instead of decrementing
, ensuring write returns the number of characters written (
) and correctly throws write_area_exhausted() when count < n.
ead_input_seq_test.hpp and write_output_seq_test.hpp with std::list forward iterator sequence test cases.
checks