summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimer.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-03-04 16:12:11 +0100
committerIvan Solovev <ivan.solovev@qt.io>2024-03-13 20:34:22 +0100
commit5ea434b09f6a760b84fb14a69cc578063cad99a1 (patch)
tree763782013f9a9f08cf789293fce13c3460d97fa2 /src/corelib/kernel/qtimer.cpp
parente55ee873e9f3e9f6047333434d5c9a4ddfe2bf6b (diff)
QOperatingSystemVersion: use partial ordering for relational operators
QOperatingSystemVersion intentionally does not define operator==() and operator!=() since ae072cd9c4a575e0ed3f073c6ab395ccdf7c2b37. It means that we cannot use comparison helper macros. Still, we can manually define four relational operators or operator<=>() in C++20 mode, and give the class a partial ordering. We choose partial ordering, because versions of different OS types are incomparable. Implement the operators in terms of helper function compareThreeWay(), which potentially allows to use this class in some templated code. As a drive-by: make the static compare() function noexcept, because it really is. Fixes: QTBUG-120360 Change-Id: Id4c9ce740e42baa719ca0ee84146d087b21675c6 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
0 files changed, 0 insertions, 0 deletions