Skip to content
New issue

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

docs: Correct terminology in std::cmp #103046

Merged
merged 1 commit into from
Oct 5, 2023

Commits on Oct 5, 2023

  1. docs: Correct terminology in std::cmp

    Some clarifications regarding used (mathematical) terminology:
    
    * Avoid using the terms "total equality" and "partial equality" in favor
      of "equivalence relation" and "partial equivalence relation", which
      are well-defined and unambiguous.
    * Clarify that `Ordering` is an ordering between two values (and not an
      order in the mathematical sense).
    * Avoid saying that `PartialEq` and `Eq` are "equality comparisons"
      because the terminology "equality comparison" could be misleading:
      it's possible to implement `PartialEq` and `Eq` for other (partial)
      equivalence relations, in particular for relations where `a == b` for
      some `a` and `b` even when `a` and `b` are not the same value.
    * Added a section "Strict and non-strict partial orders" to document
      that the `<=` and `>=` operators do not correspond to non-strict
      partial orders.
    * Corrected section "Corollaries" in documenation of Ord in regard to
      `<` only describing a strict total order in cases where `==` conforms
      to mathematical equality.
    
    Made documentation easier to understand:
    
    * Explicitly state at the beginning of `PartialEq`'s documentation
      comment that implementing the trait will provide the `==` and `!=`
      operators.
    * Added an easier to understand rule when to implement `Eq` in addition
      to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always
      returns `true`."
    * Explicitly mention in documentation of `Eq` that the properties
      "symmetric" and "transitive" are already required by `PartialEq`.
    JanBeh committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    86b031b View commit details
    Browse the repository at this point in the history