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-15 14:24:17 +0100 |
commit | 4405a5c648448cfebb9bf73798b87ed5b7b702ed (patch) | |
tree | 5a6b2390654a35808c8aed5bcdb74bece0025289 | |
parent | db0ac13d7bf4a01028d7d77cee17ac188e0638c1 (diff) | |
download | qtwebsockets-4405a5c648448cfebb9bf73798b87ed5b7b702ed.tar.gz |
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-- | examples/websockets/simplechat/chatserver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<QWebSocket *>(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); } |