From 4814ec0069a11a0e21cd3ac8c956c5a8ec7a0c5b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 11:15:43 +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: I9ace956ba9ee596ddf820623957f2d476036c5ed Reviewed-by: Fabian Kosmale --- tests/bttestui/btlocaldevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/bttestui/btlocaldevice.cpp') diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp index 2e30a311..cff7851f 100644 --- a/tests/bttestui/btlocaldevice.cpp +++ b/tests/bttestui/btlocaldevice.cpp @@ -379,7 +379,7 @@ void BtLocalDevice::serviceDiscovered(const QBluetoothServiceInfo &info) { //This is here to detect the test server for SPP testing later on bool alreadyKnown = false; - for (const QBluetoothServiceInfo& found : qAsConst(foundTestServers)) { + for (const QBluetoothServiceInfo& found : std::as_const(foundTestServers)) { if (found.device().address() == info.device().address()) { alreadyKnown = true; break; @@ -433,7 +433,7 @@ void BtLocalDevice::dumpServiceDiscovery() } qDebug() << "###### TestServer offered by:"; - for (const QBluetoothServiceInfo& found : qAsConst(foundTestServers)) { + for (const QBluetoothServiceInfo& found : std::as_const(foundTestServers)) { qDebug() << found.device().name() << found.device().address().toString(); } } @@ -769,7 +769,7 @@ void BtLocalDevice::dumpServerInformation() //server->setSecurityFlags(secFlag); - for (const QBluetoothSocket *client : qAsConst(serverSockets)) { + for (const QBluetoothSocket *client : std::as_const(serverSockets)) { qDebug() << "##" << client->localAddress().toString() << client->localName() << client->localPort(); qDebug() << "##" << client->peerAddress().toString() -- cgit v1.2.1