17 Language support library [support]

17.12 Comparisons [cmp]

17.12.7 Type Ordering [compare.type]

There is an implementation-defined total ordering of all types.
For any (possibly incomplete) types X and Y, the expression TYPE-ORDER(X, Y) is a constant expression ([expr.const]) of type strong_ordering ([cmp.strongord]).
Its value is strong_ordering​::​less if X precedes Y in this implementation-defined total order, strong_ordering​::​greater if Y precedes X, and strong_ordering​::​equal if they are the same type.
[Note 1: 
int, const int and int& are different types.
— end note]
[Note 2: 
This ordering need not be consistent with the one induced by type_info​::​before.
— end note]
[Note 3: 
The ordering of TU-local types from different translation units is not observable, because the necessary specialization of type_order is impossible to name.
— end note]
template<class T, class U> struct type_order;
The name type_order denotes a Cpp17BinaryTypeTrait ([meta.rqmts]) with a base characteristic of integral_constant<strong_ordering, TYPE-ORDER(T, U)>.
Recommended practice: The order should be lexicographical on parameter-type-lists and template argument lists.