Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::is_equality< T, Rel > Struct Template Referenceexport

Trait: Rel on T is equality, the diagonal Δ: Rel(a, b) holds iff a and b are the same value. More...

Inheritance diagram for dedekind::category::is_equality< T, Rel >:
Collaboration diagram for dedekind::category::is_equality< T, Rel >:

Detailed Description

template<typename T, typename Rel>
struct dedekind::category::is_equality< T, Rel >

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.


The documentation for this struct was generated from the following file: