Use std::as_const (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-04-17 22:21:18 +01:00
parent 6d617f40a4
commit 33209fa1eb
42 changed files with 92 additions and 103 deletions

View File

@@ -371,7 +371,7 @@ namespace BlackCore
myAircraft.getHeading().normalizedTo360Degrees().value(CAngleUnit::deg()),
myAircraft.getParts().isOnGround());
for (const auto &receiver : as_const(m_interimPositionReceivers))
for (const auto &receiver : std::as_const(m_interimPositionReceivers))
{
interimPilotDataUpdate.setReceiver(receiver.asString());
sendQueudedMessage(interimPilotDataUpdate);
@@ -1774,7 +1774,7 @@ namespace BlackCore
{
emit atisLogoffTimeReplyReceived(sender, message);
CInformationMessage atisMessage(CInformationMessage::ATIS);
for (const auto &line : as_const(pendingQuery.m_atisMessage))
for (const auto &line : std::as_const(pendingQuery.m_atisMessage))
{
if (!atisMessage.isEmpty()) atisMessage.appendMessage("\n");
atisMessage.appendMessage(line);
@@ -1871,7 +1871,7 @@ namespace BlackCore
}
if (callStatistics.isEmpty()) { return QString(); }
for (const auto [key, value] : makePairsRange(as_const(callStatistics)))
for (const auto [key, value] : makePairsRange(std::as_const(callStatistics)))
{
// key is pair.first, value is pair.second
transformed.push_back({ value, key });
@@ -1975,7 +1975,7 @@ namespace BlackCore
if (m_printToConsole) { qDebug() << "FSD Recv=>" << line; }
emitRawFsdMessage(line, false);
for (const QString &str : makeKeysRange(as_const(m_messageTypeMapping)))
for (const QString &str : makeKeysRange(std::as_const(m_messageTypeMapping)))
{
if (line.startsWith(str))
{