6 #ifndef SWIFT_MISC_COMPAREFUNCTIONS_H
7 #define SWIFT_MISC_COMPAREFUNCTIONS_H
14 namespace swift::misc::Compare
17 template <
typename T, std::enable_if_t<std::is_arithmetic_v<T>,
int> = 0>
20 if (a < b) {
return -1; }
21 if (b < a) {
return 1; }
26 template <
typename T, std::enable_if_t<std::is_enum_v<T>,
int> = 0>
29 using UT = std::underlying_type_t<T>;
30 return compare(
static_cast<UT
>(a),
static_cast<UT
>(b));
38 return compare(
static_cast<UT
>(a),
static_cast<UT
>(b));
int compare(T a, T b)
Compare arithmetic values.
qint64 toMSecsSinceEpoch() const const