refactor: port to capy's io_result tuple alias - #339
Merged
Conversation
capy's io_result is now an alias for std::tuple<error_code, Ts...>,
so the .ec member is gone; held results read the error through
std::get<0>. Structured-binding call sites are unchanged. The
{{}, n} success shorthand becomes std::error_code() explicitly,
since the leading {} also matches allocator_arg_t in libstdc++'s
allocator-extended tuple constructors.
The alias cannot carry the type-level [[nodiscard]], so every
awaitable whose await_resume returns an io_result marks the
function [[nodiscard]] instead, preserving the discarded-error
diagnostic for corosio operations.
The TLS engine_result struct keeps its own ec member and is
untouched.
|
An automated preview of the documentation is available at https://339.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-08-17 19:04:31 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #339 +/- ##
===========================================
- Coverage 79.82% 79.78% -0.04%
===========================================
Files 96 96
Lines 5937 5926 -11
Branches 1209 1209
===========================================
- Hits 4739 4728 -11
Misses 851 851
Partials 347 347
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.
capy's io_result is now an alias for std::tuple<error_code, Ts...>, so the .ec member is gone; held results read the error through std::get<0>. Structured-binding call sites are unchanged. The {{}, n} success shorthand becomes std::error_code() explicitly, since the leading {} also matches allocator_arg_t in libstdc++'s allocator-extended tuple constructors.
The alias cannot carry the type-level [[nodiscard]], so every awaitable whose await_resume returns an io_result marks the function [[nodiscard]] instead, preserving the discarded-error diagnostic for corosio operations.
The TLS engine_result struct keeps its own ec member and is untouched.
Related to cppalliance/capy#266