From 4405a5c648448cfebb9bf73798b87ed5b7b702ed Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 11 Nov 2022 16:26:04 +0100 Subject: 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 --- examples/websockets/simplechat/chatserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/websockets/simplechat/chatserver.cpp b/examples/websockets/simplechat/chatserver.cpp index 2704c0b..79d7c62 100644 --- a/examples/websockets/simplechat/chatserver.cpp +++ b/examples/websockets/simplechat/chatserver.cpp @@ -57,7 +57,7 @@ void ChatServer::onNewConnection() void ChatServer::processMessage(const QString &message) { QWebSocket *pSender = qobject_cast(sender()); - for (QWebSocket *pClient : qAsConst(m_clients)) { + for (QWebSocket *pClient : std::as_const(m_clients)) { if (pClient != pSender) //don't echo message back to sender pClient->sendTextMessage(message); } -- cgit v1.2.1