17 Language support library [support] (original) (raw)

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 Yin this implementation-defined total order,strong_ordering​::​greater if Y precedes X, andstrong_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_]