8#pragma qt_class(QtMinMax)
9#pragma qt_sync_stop_processing
12#include <QtCore/qassert.h>
13#include <QtCore/qtconfigmacros.h>
14#include <QtCore/qttypetraits.h>
19constexpr inline const T &qMin(
const T &a,
const T &b) {
return (a < b) ? a : b; }
21constexpr inline const T &
qMax(
const T &a,
const T &b) {
return (a < b) ? b : a; }
23constexpr inline const T &
qBound(
const T &min,
const T &val,
const T &max)
25 Q_ASSERT(!(max < min));
26 return qMax(min, qMin(max, val));
28template <
typename T,
typename U>
31 using P = QTypeTraits::Promoted<T, U>;
34 return (_a < _b) ? _a : _b;
36template <
typename T,
typename U>
39 using P = QTypeTraits::Promoted<T, U>;
42 return (_a < _b) ? _b : _a;
44template <
typename T,
typename U>
47 Q_ASSERT(!(max < min));
48 return qMax(min, qMin(max, val));
50template <
typename T,
typename U>
53 using P = QTypeTraits::Promoted<T, U>;
54 Q_ASSERT(!(P(max) < P(min)));
55 return qMax(min, qMin(max, val));
57template <
typename T,
typename U>
60 using P = QTypeTraits::Promoted<T, U>;
61 Q_ASSERT(!(P(max) < P(min)));
62 return qMax(min, qMin(max, val));
constexpr QTypeTraits::Promoted< T, U > qMin(const T &a, const U &b)
constexpr QTypeTraits::Promoted< T, U > qBound(const T &min, const T &val, const U &max)
constexpr QTypeTraits::Promoted< T, U > qBound(const T &min, const U &val, const T &max)
constexpr QTypeTraits::Promoted< T, U > qBound(const U &min, const T &val, const T &max)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
constexpr QTypeTraits::Promoted< T, U > qMax(const T &a, const U &b)