mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
refs #624 Use std::make_unique instead of BlackMisc::make_unique.
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_MAKEUNIQUE_H
|
||||
#define BLACKMISC_MAKEUNIQUE_H
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Own implementation of std::make_unique, a C++14 feature not provided by GCC in C++11 mode
|
||||
template<typename T, typename... Args>
|
||||
std::unique_ptr<T> make_unique(Args &&... args)
|
||||
{
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgparser.h"
|
||||
#include "blackmisc/simulation/xplane/aircraftmodelloaderxplane.h"
|
||||
#include "blackmisc/simulation/xplane/xplaneutil.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Simulation::XPlane;
|
||||
@@ -58,7 +57,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (simInfo.xplane())
|
||||
{
|
||||
return make_unique<CAircraftModelLoaderXPlane>(
|
||||
return std::make_unique<CAircraftModelLoaderXPlane>(
|
||||
CSimulatorInfo(CSimulatorInfo::XPLANE),
|
||||
CXPlaneUtil::xplaneRootDir());
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/predicates.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -36,21 +35,21 @@ namespace BlackMisc
|
||||
{
|
||||
if (simInfo.fsx())
|
||||
{
|
||||
return make_unique<CAircraftCfgParser>(
|
||||
return std::make_unique<CAircraftCfgParser>(
|
||||
CSimulatorInfo(CSimulatorInfo::FSX),
|
||||
CFsCommonUtil::fsxSimObjectsDir(),
|
||||
CFsCommonUtil::fsxSimObjectsExcludeDirectories());
|
||||
}
|
||||
else if (simInfo.fs9())
|
||||
{
|
||||
return make_unique<CAircraftCfgParser>(
|
||||
return std::make_unique<CAircraftCfgParser>(
|
||||
CSimulatorInfo(CSimulatorInfo::FS9),
|
||||
CFsCommonUtil::fs9AircraftDir(),
|
||||
CFsCommonUtil::fs9AircraftObjectsExcludeDirectories());
|
||||
}
|
||||
else if (simInfo.p3d())
|
||||
{
|
||||
return make_unique<CAircraftCfgParser>(
|
||||
return std::make_unique<CAircraftCfgParser>(
|
||||
CSimulatorInfo(CSimulatorInfo::P3D),
|
||||
CFsCommonUtil::p3dSimObjectsDir(),
|
||||
CFsCommonUtil::p3dSimObjectsExcludeDirectories());
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "metardecoder.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/weather/presentweather.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
#include <QRegularExpression>
|
||||
#include <QDebug>
|
||||
|
||||
@@ -835,21 +834,21 @@ namespace BlackMisc
|
||||
void CMetarDecoder::allocateDecoders()
|
||||
{
|
||||
m_decoders.clear();
|
||||
m_decoders.push_back(make_unique<CMetarDecoderReportType>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderAirport>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderDayTime>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderStatus>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderWind>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderVariationsWindDirection>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderVisibility>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderRunwayVisualRange>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderPresentWeather>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderCloud>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderVerticalVisibility>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderTemperature>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderPressure>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderRecentWeather>());
|
||||
m_decoders.push_back(make_unique<CMetarDecoderWindShear>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderReportType>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderAirport>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderDayTime>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderStatus>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderWind>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderVariationsWindDirection>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderVisibility>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderRunwayVisualRange>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderPresentWeather>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderCloud>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderVerticalVisibility>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderTemperature>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderPressure>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderRecentWeather>());
|
||||
m_decoders.push_back(std::make_unique<CMetarDecoderWindShear>());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user