feat: add read_at_least and write_at_least algorithms (#260)#347
Merged
mvandeberg merged 1 commit intoJul 1, 2026
Merged
Conversation
Add read_at_least and write_at_least as straightforward extensions of
read/write. Where read/write transfer exactly buffer_size(buffers) bytes,
the _at_least variants stop as soon as a minimum of n bytes have been
transferred, keeping any bytes a single read_some/write_some delivers
beyond n without looping again. This serves the buffered-source case
where n bytes are required but the remaining buffer capacity is optional.
If n exceeds buffer_size(buffers) the request is impossible to satisfy and
the operation fails immediately with {std::errc::invalid_argument, 0}.
A contingency that coincides with reaching n is suppressed: a satisfied
request is a success, mirroring read/write.
|
An automated preview of the documentation is available at https://347.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-07-01 18:23:06 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop-2 #347 +/- ##
==========================================
Coverage 98.29% 98.29%
==========================================
Files 77 79 +2
Lines 3984 3986 +2
==========================================
+ Hits 3916 3918 +2
Misses 68 68
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
Add read_at_least and write_at_least as straightforward extensions of read/write. Where read/write transfer exactly buffer_size(buffers) bytes, the _at_least variants stop as soon as a minimum of n bytes have been transferred, keeping any bytes a single read_some/write_some delivers beyond n without looping again. This serves the buffered-source case where n bytes are required but the remaining buffer capacity is optional.
If n exceeds buffer_size(buffers) the request is impossible to satisfy and the operation fails immediately with {std::errc::invalid_argument, 0}. A contingency that coincides with reaching n is suppressed: a satisfied request is a success, mirroring read/write.