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 23:52:04 +0100 |
commit | 4979e677ebc2c85e09bc67939081f70cf78484d2 (patch) | |
tree | 354ce5a4fe65890263de45a55cce245dafeefc09 /src/qml/qml/qqml.cpp | |
parent | 7a501ec6c82c8f8d5997b5d30e667d7820faed1c (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>
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r-- | src/qml/qml/qqml.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index 72a287c318..07a8f1e278 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -581,7 +581,7 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data) auto revisions = prepareRevisions(type.instanceMetaObject, added) + furtherRevisions; uniqueRevisions(&revisions, type.version, added); - for (QTypeRevision revision : qAsConst(revisions)) { + for (QTypeRevision revision : std::as_const(revisions)) { if (revision.hasMajorVersion() && revision.majorVersion() > type.version.majorVersion()) break; @@ -624,7 +624,7 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data) revisions.append(added); uniqueRevisions(&revisions, type.version, added); - for (QTypeRevision revision : qAsConst(revisions)) { + for (QTypeRevision revision : std::as_const(revisions)) { if (revision < added) continue; if (revision.hasMajorVersion() && revision.majorVersion() > type.version.majorVersion()) |