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.

Task-number: QTBUG-99313
Change-Id: Ie5b276174d8446a6ddbca11a6a8e3e07d3bca675
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Marc Mutz 2022-10-06 11:33:26 +02:00
parent 196c460d35
commit b3cbf8d925
1 changed files with 1 additions and 1 deletions

View File

@ -495,7 +495,7 @@ void tst_qtiff::supportsOption()
allOptions.remove(QImageIOHandler::ImageOption(options.at(i)));
}
for (QImageIOHandler::ImageOption option : qAsConst(allOptions))
for (QImageIOHandler::ImageOption option : std::as_const(allOptions))
QVERIFY(!writer.supportsOption(option));
}