diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2013-05-09 11:42:05 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-03 13:19:35 +0200 |
commit | 3006bd2d44298babd1339c3fc3a67ad0696bcefc (patch) | |
tree | 985bec0889f7d2dfbcde59848aeac9e0ea42df2a /src/corelib/tools/qelapsedtimer.h | |
parent | 8d0e6000cb326130605b2b5e688e9cdc65950794 (diff) |
Make QElapsedTimer default to invalid (and now non-POD).
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.
[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.
Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/tools/qelapsedtimer.h')
-rw-r--r-- | src/corelib/tools/qelapsedtimer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/tools/qelapsedtimer.h b/src/corelib/tools/qelapsedtimer.h index b06afe4ab4..7df5dec63a 100644 --- a/src/corelib/tools/qelapsedtimer.h +++ b/src/corelib/tools/qelapsedtimer.h @@ -57,6 +57,13 @@ public: MachAbsoluteTime, PerformanceCounter }; + + Q_DECL_CONSTEXPR QElapsedTimer() + : t1(Q_INT64_C(0x8000000000000000)) + , t2(Q_INT64_C(0x8000000000000000)) + { + } + static ClockType clockType() Q_DECL_NOTHROW; static bool isMonotonic() Q_DECL_NOTHROW; |