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

steve-downey / free_value_or / 34077508795
98%

Build:
DEFAULT BRANCH: main
Ran 07 Sep 2026 02:57AM UTC
Jobs 1
Files 7
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 Sep 2026 02:48AM UTC coverage: 96.803%. Remained the same
34077508795

push

github

steve-downey
Move payloads out of rvalue nullables, by ownership

Correct by default, at some ergonomic cost. The dereference type is now
deref_t<T> = decltype(*declval<T>()) rather than iter_reference_t<T>, so the
value category of the nullable reaches its payload and the engaged path
moves: value_or(std::move(o), u) now matches std::move(o).value_or(u)
instead of pessimizing against it.

The division this creates is the reason to want it. optional and expected
own their value, so an expiring one has an expiring payload, operator* is
ref-qualified, and they move. T*, shared_ptr, unique_ptr and optional<T&>
are handles to a referent that ordinarily outlives them, so they yield T&
and go on copying. Each reports what its own value category implies, and
each is right. The observe-only alternative is simpler to state and makes
every owning nullable copy a payload that is going away; it stays available
as a one-line change to the dereference type if LEWG prefers it.

Only reference_or changes signature: over an owning rvalue nullable it
becomes const T&, the common reference of T&& and T&. common_type decays, so
value_or, or_invoke and or_construct are unchanged, which is why nothing in
the rest of the suite moved. The rvalue tests flip to assert moves for the
owning models and keep asserting copies for the handles, with optional<T&>
and a raw pointer as the cases that show the split is ownership and not
optional-ness.

Open questions are down to one: whether reference_or must yield a reference.
The rvalue question moves to the decided list.

Also lands two corrections that an earlier commit claimed but did not make.
Batched edits died on an assertion before writing, so the test-count and
matrix lines never changed and the P3413 comparison row still read "observes
only". Counts are now 118 test cases and nine negative-compilation cases
over eight translation units.

4 of 4 new or added lines in 1 file covered. (100.0%)

1090 of 1126 relevant lines covered (96.8%)

17813.06 hits per line

Jobs
ID Job ID Ran Files Coverage
1 34077508795.1 07 Sep 2026 02:57AM UTC 7
96.8
GitHub Action Run
Source Files on build 34077508795
  • Tree
  • List 7
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34077508795
  • a0a495d6 on github
  • Prev Build on main (#34076657849)
  • Next Build on main (#34438175402)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc