|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Total-order layer (stronger than :poset).
More...
#include <compare>#include <concepts>#include <functional>import dedekind.order:poset;import dedekind.category;
Concepts | |
| concept | dedekind::order::IsStrictWeakOrder |
| The standard C++ 'Compare' requirement (e.g., for std::sort). | |
| concept | dedekind::order::IsTotallyOrdered |
| A refinement where every pair is comparable (The Chain). | |
| concept | dedekind::order::IsLinearOrder |
| Synonym for Total Order. | |
| concept | dedekind::order::HasTotalOrderOperators |
Pure syntactic shape: T supports the spaceship operator <=> alongside the four partial-order operators (the latter return L::Ω). | |
| concept | dedekind::order::HasTotalOrderOperatorsWith |
Heterogeneous shape: T and U can be compared via <=> in both directions, alongside the four partial-order operators (the latter return L::Ω). | |
Total-order layer (stronger than :poset).
@partition :total
Concepts that genuinely require comparability of every pair (the chain axiom): IsTotallyOrdered, IsLinearOrder, IsStrictWeakOrder, the spaceship-aware shape concept HasTotalOrderOperators, and the heterogeneous variant HasTotalOrderOperatorsWith<T, U>. All of these compose IsPartiallyOrdered / HasPartialOrderOperators from :poset; the split lets generic code that needs only the partial-order content not pull in the strictly-stronger total-order machinery (cf. :category:total which already houses the strict total-axiomatic content for algebra; this partition is its order sibling). Per #410.
HasTotalOrderOperatorsWith<T, U> — and its partial-order sibling in :poset — fill the seam between the homogeneous <=>-shape (which only describes T <=> T) and the real-world need to compare a variant carrier (e.g. SignedCardinality) with an integer NTTP literal (e.g. from -21). Names the cross-type shape that the halfspace machinery silently relies on. Per #415 / cross-issue note on PR #422.
Wikipedia: Total order, Strict weak ordering, Three-way comparison