Skip to content

Constrain protocol constructors and assignment on constructibility - #527

Merged
philipcraig merged 3 commits into
mainfrom
constructible-constraints-500
Nov 28, 2026
Merged

philipcraig merged 3 commits into
mainfrom
constructible-constraints-500

Conversation

@philipcraig

Copy link
Copy Markdown
Collaborator

Closes #500.

The value, allocator-extended value, in-place and converting-assignment overloads now require the stored type to be constructible from the arguments, as polymorphic does.

protocol<ImmovableInterface> is no longer reported constructible from an Immovable object: constructing it would have to move the object.

The value, in-place and converting-assignment overloads checked
conformance and the interface's special members but not that the stored
type can be constructed from the arguments, so traits reported
constructibility that the definition could not deliver.
@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.69%. Comparing base (8cdc487) to head (2717f43).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   95.90%   95.69%   -0.21%     
==========================================
  Files          11       11              
  Lines         927      929       +2     
  Branches       30       31       +1     
==========================================
  Hits          889      889              
  Misses         28       28              
- Partials       10       12       +2     
Flag Coverage Δ
consteval 89.65% <ø> (ø)
runtime 98.05% <ø> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@philipcraig
philipcraig marked this pull request as ready for review November 28, 2026 18:10
@philipcraig
philipcraig requested a review from jbcoe as a code owner November 28, 2026 18:10
@philipcraig
philipcraig requested a review from RyanJK5 November 28, 2026 18:10

@jbcoe jbcoe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for this.

@philipcraig
philipcraig merged commit 4557bc1 into main Nov 28, 2026
23 checks passed
@philipcraig
philipcraig deleted the constructible-constraints-500 branch November 28, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constrain protocol's constructors and converting assignment on constructibility of the stored type

2 participants