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]