We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
三路运算符 https://en.cppreference.com/w/cpp/language/operator_comparison#Three-way_comparison
PartialOrd https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html
从返回值的角度应该是Ord更类似 而且Rust写明了需要传递性…… 再者 std::strong_ordering 和 std::weak_ordering 要求 a < b, a > b, a = b 恰有一个为true,而他们是 <=> 返回值
The text was updated successfully, but these errors were encountered:
看起来三路运算符并不能严格对应 Ord 或者 PartialOrd,或者说既可能对应 Ord 也可能对应 PartialOrd,取决于定义这个函数的时候的返回类型。
Sorry, something went wrong.
No branches or pull requests
三路运算符
https://en.cppreference.com/w/cpp/language/operator_comparison#Three-way_comparison
PartialOrd
https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html
从返回值的角度应该是Ord更类似
而且Rust写明了需要传递性……
再者 std::strong_ordering 和 std::weak_ordering 要求 a < b, a > b, a = b 恰有一个为true,而他们是 <=> 返回值
The text was updated successfully, but these errors were encountered: