• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bemanproject / sandbox-expected / 28866262267
97%

Build:
DEFAULT BRANCH: main
Ran 07 Jul 2026 12:42PM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Jul 2026 12:30PM UTC coverage: 97.017% (+6.8%) from 90.196%
28866262267

push

github

web-flow
Expected over references (#61)

## Expected over References — Implementation of D4280R0

### Summary

Implements four partial specializations of `beman::expected` that allow
reference types as `T` and/or `E`, as proposed in [D4280R0 (Expected
over References)](https://wg21.link/D4280R0):

| Specialization | Storage | Step |
|---|---|---|
| `expected<T&, E>` | `T*` + `union { E }` + bool | 7 |
| `expected<T, E&>` | `union { T }` + `E*` + bool | 8 |
| `expected<T&, E&>` | `T*` + `E*` + bool | 9 |
| `expected<void, E&>` | `E*` + bool | 10 |

This is a reordered, cleaned-up replay of `expected-over-references`
(see that branch's own PR for the original messy history) — the final
code/tests/docs are the same feature, restructured so `unexpected<E&>`
is specialized first and the error-reference axis collapses into the
primary/void templates from the start, instead of building and later
discarding three separate reference-error specializations.

On top of that replay, this branch is merged with `main`'s new
std::expected parity test harness (parameterizes the behavioral test
suite to run against both `beman::expected` and `std::expected`),
resolving the merge conflict between the two and fixing two
toolchain-specific issues that surfaced running the merged suite in CI
(see `docs/std-parity.md`):

- A `[[nodiscard]]`-discard warning under `-Werror`.
- A libc++ cross-specialization friend-access bug in heterogeneous
`std::unexpected` comparison (guarded out for `std::expected`, not a
beman defect).

The std::expected parity target (`.std`) is also skipped entirely on
libc++ — libc++ has independent bugs of its own in this exact area (see
`docs/std-parity.md`) that aren't worth chasing; it continues to run
normally under gcc/libstdc++ and clang-with-libstdc++.

**CI:** full matrix green (gcc 13–16, clang 19–22, appleclang, libstdc++
and libc++, multiple sanitizer/Werror/coverage/modules configurations).

### Design decisions

All four specializations follow the... (continued)

257 of 257 new or added lines in 2 files covered. (100.0%)

19 existing lines in 1 file now uncovered.

683 of 704 relevant lines covered (97.02%)

25.96 hits per line

Coverage Regressions

Lines Coverage ∆ File
19
97.12
7.23% include/beman/expected/expected.hpp
Jobs
ID Job ID Ran Files Coverage
1 28866262267.1 07 Jul 2026 12:42PM UTC 3
97.02
GitHub Action Run
Source Files on build 28866262267
  • Tree
  • List 3
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28866262267
  • 7cda0c24 on github
  • Prev Build on main (#27134856133)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc