Skip to content

refactor: port to capy's io_result tuple alias - #339

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/io-result-tuple-alias
Aug 17, 2026
Merged

refactor: port to capy's io_result tuple alias#339
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/io-result-tuple-alias

Conversation

@sgerbino

Copy link
Copy Markdown
Collaborator

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

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.
@cppalliance-bot

Copy link
Copy Markdown

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

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.78%. Comparing base (1f3d91d) to head (f5dd942).

Additional details and impacted files

Impacted file tree graph

@@             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              
Files with missing lines Coverage Δ
include/boost/corosio/io/io_signal_set.hpp 96.00% <ø> (-0.16%) ⬇️
include/boost/corosio/native/native_resolver.hpp 92.59% <ø> (-0.27%) ⬇️
include/boost/corosio/native/native_signal_set.hpp 100.00% <ø> (ø)
...clude/boost/corosio/native/native_tcp_acceptor.hpp 90.62% <ø> (-0.29%) ⬇️
include/boost/corosio/native/native_tcp_socket.hpp 90.00% <ø> (-0.42%) ⬇️
include/boost/corosio/resolver.hpp 94.93% <ø> (-0.13%) ⬇️
include/boost/corosio/tcp_acceptor.hpp 91.66% <ø> (-0.18%) ⬇️
include/boost/corosio/test/mocket.hpp 86.69% <ø> (-0.13%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f3d91d...f5dd942. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgerbino
sgerbino merged commit 4b1e9b3 into cppalliance:develop Aug 17, 2026
47 of 85 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Aug 17, 2026
@sgerbino
sgerbino deleted the pr/io-result-tuple-alias branch August 17, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants