From 6e351d5f45c82c0773b7d0731be370793bca30a5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 11:45:46 +0200 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. Task-number: QTBUG-99313 Change-Id: Ib7233b40047e539a08daece8bbc4576f0ced7026 Reviewed-by: Allan Sandfeld Jensen --- examples/websockets/simplechat/chatserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') 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