summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_winrt.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 16:26:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-12 08:42:25 +0100
commit2f2e25c3beea21c14bb75b2f32b5ee4700759a89 (patch)
treeeff1132b9135642b076cec6796691f91bbd07188 /src/bluetooth/qlowenergycontroller_winrt.cpp
parentcad49b3be482b41f1ae43b5c9ce4d009a810240b (diff)
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: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_winrt.cpp')
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp
index e7b87d12..3cebc697 100644
--- a/src/bluetooth/qlowenergycontroller_winrt.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt.cpp
@@ -847,7 +847,7 @@ void QLowEnergyControllerPrivateWinRT::registerForValueChanges(const QBluetoothU
{
qCDebug(QT_BT_WINDOWS) << "Registering characteristic" << charUuid << "in service"
<< serviceUuid << "for value changes";
- for (const ValueChangedEntry &entry : qAsConst(mValueChangedTokens)) {
+ for (const ValueChangedEntry &entry : std::as_const(mValueChangedTokens)) {
GUID guuid;
HRESULT hr;
hr = entry.characteristic->get_Uuid(&guuid);
@@ -882,7 +882,7 @@ void QLowEnergyControllerPrivateWinRT::unregisterFromValueChanges()
{
qCDebug(QT_BT_WINDOWS) << "Unregistering " << mValueChangedTokens.size() << " value change tokens";
HRESULT hr;
- for (const ValueChangedEntry &entry : qAsConst(mValueChangedTokens)) {
+ for (const ValueChangedEntry &entry : std::as_const(mValueChangedTokens)) {
if (!entry.characteristic) {
qCWarning(QT_BT_WINDOWS) << "Unregistering from value changes for characteristic failed."
<< "Characteristic has been deleted";
@@ -1298,7 +1298,7 @@ void QLowEnergyControllerPrivateWinRT::discoverServiceDetailsHelper(
pointer->endHandle = endHandle;
pointer->characteristicList = charList;
- for (const QBluetoothUuid &indicateChar : qAsConst(indicateChars))
+ for (const QBluetoothUuid &indicateChar : std::as_const(indicateChars))
registerForValueChanges(service, indicateChar);
pointer->setState(QLowEnergyService::RemoteServiceDiscovered);