diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:45:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 14:30:52 +0200 |
commit | 6e351d5f45c82c0773b7d0731be370793bca30a5 (patch) | |
tree | b1c59f9a511eecda761308db70d2fc76262187e9 | |
parent | 76dd96c50d3d7abc810b188df75622159e764f60 (diff) | |
download | qtwebsockets-6e351d5f45c82c0773b7d0731be370793bca30a5.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.
Task-number: QTBUG-99313
Change-Id: Ib7233b40047e539a08daece8bbc4576f0ced7026
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@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); } |