Skip to content

fix: derive unexpected inequality from equality - #37

Merged
X1aomu merged 2 commits into
mainfrom
fix/unexpected-inequality
Oct 13, 2026
Merged

X1aomu merged 2 commits into
mainfrom
fix/unexpected-inequality

Conversation

@X1aomu

@X1aomu X1aomu commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #36, addressing the same noexcept issue in unexpected::operator!=: the implicit conversion of the comparison result to bool is not accounted for.

Use wrapper equality and its exception specification in C++17, and rely on rewritten comparisons in C++20 and later. This reuses the corrected operator== from #36, supports equality-only error types, and makes wrapper inequality negate wrapper equality even when the error type defines != independently.

Use wrapper equality and its exception specification in C++17, and rely
on rewritten comparisons in C++20 and later.

This supports equality-only error types and propagates exceptions from
equality or bool conversion. Wrapper inequality now follows the negation
of wrapper equality even when the error type defines != independently.
@X1aomu
X1aomu merged commit 2575526 into main Oct 13, 2026
62 checks passed
@X1aomu
X1aomu deleted the fix/unexpected-inequality branch October 13, 2026 04:07
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.

1 participant