summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qelapsedtimer.h
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2013-05-09 11:42:05 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-09-03 13:19:35 +0200
commit3006bd2d44298babd1339c3fc3a67ad0696bcefc (patch)
tree985bec0889f7d2dfbcde59848aeac9e0ea42df2a /src/corelib/tools/qelapsedtimer.h
parent8d0e6000cb326130605b2b5e688e9cdc65950794 (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.h7
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;