diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:15:43 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 13:19:37 +0200 |
commit | 4814ec0069a11a0e21cd3ac8c956c5a8ec7a0c5b (patch) | |
tree | 71002a95b6d07bb39a348ef19f31586a7535e8ce /tests/bttestui/btlocaldevice.cpp | |
parent | 9aa00a81fd54b2d1d7b3e9e20c407e2d43571d41 (diff) | |
download | qtconnectivity-4814ec0069a11a0e21cd3ac8c956c5a8ec7a0c5b.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: I9ace956ba9ee596ddf820623957f2d476036c5ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/bttestui/btlocaldevice.cpp')
-rw-r--r-- | tests/bttestui/btlocaldevice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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() |