|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Trait: Rel on T is equality, the diagonal Δ: Rel(a, b) holds iff a and b are the same value.
More...


Trait: Rel on T is equality, the diagonal Δ: Rel(a, b) holds iff a and b are the same value.
Stronger than an equivalence: it is the finest one, and the one under which every function respects its arguments (Leibniz: substituting equals for equals changes no result). So it is not implied by std::regular<T>: double is regular, yet NaN == NaN is false (no equivalence at all) and -0.0 == +0.0 while 1/(-0.0) != 1/(+0.0) (an equivalence, but not the diagonal). A type whose == compares a representation coarser than its values is in the same position. Certified for the built-in integral types and bool; a product inherits it from its factors (Δ_A × Δ_B = Δ_{A×B}); any other carrier registers its own.