Skip to content

Add less-than, ordering and there-way traits - #698

Merged
nunoplopes merged 27 commits into
Cpp2Rust:masterfrom
lucic71:ord-as-cpp-trait
Dec 3, 2026
Merged

nunoplopes merged 27 commits into
Cpp2Rust:masterfrom
lucic71:ord-as-cpp-trait

Conversation

@lucic71

@lucic71 lucic71 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #697

Closes #677

Added LessThanComparable, TotallyOrdered and ThreeWayComparable.

LessThanComparable only requires operator<.
TotallyOrdered requires <, >, <=, >=.
ThreeWayComparable requires <=>.


Removed PartialOrd and Ord.

@lucic71

lucic71 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Ptr, FnPtr and AnyPtr continue to have PartialOrd and Ord so that we can write a < b inside the user code instead of using the traits, the traits are used only in rules.

@nunoplopes
nunoplopes merged commit d803636 into Cpp2Rust:master Dec 3, 2026
8 of 9 checks passed
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.

Spaceship operator always returns strong_ordering

2 participants