Let C++20 rewriting synthesize sum's operator!=#299
Merged
Conversation
🤖 Augment PR SummarySummary: This PR removes the hand-written Changes:
Why: Prevents constraint drift where 🤖 Was this summary useful? React with 👍 or 👎 |
683c4a1 to
3beae5a
Compare
The hand-written `operator!=` dropped the arity conjuncts `operator==` carries, so against a `sum<>` operand its constraint was satisfied while `==`'s was not: the call reported itself viable and then failed to compile in its own body, where `not(lh == rh)` found no `operator==`. A constraint that lies. Deleting it makes `a != b` a rewritten `!(a == b)`, which inherits `operator==`'s constraints by construction, so the two cannot drift apart again. Closes #281 Assisted-by: Claude:claude-opus-4-8[1m]
54e67e6 to
dbd8898
Compare
Member
Author
|
augment review |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Member
Author
|
augment review |
Bronek
added a commit
that referenced
this pull request
Jul 13, 2026
Retire #281's tripwires: a rewritten != inherits =='s constraints, so the two now drop out together against the uninstantiable sum<>. The probes move to the equality section, where #299 puts them and where they belong - the noexcept section keeps only what it weighs - and carry both operand orders from #299 plus the empty-on-empty pair the tripwires had. Assisted-by: Claude:claude-opus-4-8[1m]
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.



The hand-written
operator!=dropped the arity conjunctsoperator==carries, so against asum<>operand its constraint was satisfied while=='s was not: the call reported itself viable and then failed to compile in its own body, wherenot(lh == rh)found nooperator==. A constraint that lies.Deleting it makes
a != ba rewritten!(a == b), which inheritsoperator=='s constraints by construction, so the two cannot drift apart again.Closes #281
Stack: P5 of 13 — the release-0.1 bugfix queue, merging bottom-up into
main. Based on #298 and to be retargeted tomainonce it merges; the diff shows only this PR's commits. Every stack boundary was validated with a gcc build and the full test suite on top ofmain, and the aggregate branch ran the full CI matrix green (#289).