diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-11-11 16:26:04 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-18 22:00:21 +0100 |
commit | a19e7eb676f690bc8cfbb0432da25b5917e942f3 (patch) | |
tree | ba187c2c7c141f762c8a27702bc5c21a1f8425ad | |
parent | e7e008b5384aa11918637559a1cc99422f468236 (diff) |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
This is a 6.4 re-run of the script we ran in dev, in order to avoid
conflicts between the branches when cherry-picking.
Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp index da6621c5..b5fa1090 100644 --- a/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp +++ b/src/plugins/sensorgestures/qtsensors/qwhipsensorgesturerecognizer.cpp @@ -102,7 +102,7 @@ void QWhipSensorGestureRecognizer::accelChanged(QAccelerometerReading *reading) zList.removeLast(); qreal averageZ = 0; - for (const qreal& az : qAsConst<QList<qreal>>(zList)) + for (const qreal& az : std::as_const<QList<qreal>>(zList)) averageZ += az; averageZ /= zList.count(); @@ -175,7 +175,7 @@ void QWhipSensorGestureRecognizer::checkForWhip() whipOk = false; int check = 0; - for (const qreal& az : qAsConst<QList<qreal>>(zList)) { + for (const qreal& az : std::as_const<QList<qreal>>(zList)) { if (az < -10) check++; } |