Merge pull request #4304 from B3n30/std_optional

Replace boost::optional with std::optional where possible
This commit is contained in:
Weiyi Wang 2018-10-11 12:40:00 -04:00 committed by GitHub
commit 9adc407112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 115 additions and 109 deletions

View file

@ -317,12 +317,12 @@ void ConfigureInput::setPollingResult(const Common::ParamPackage& params, bool a
poller->Stop();
}
if (!abort) {
if (!abort && input_setter) {
(*input_setter)(params);
}
updateButtonLabels();
input_setter = boost::none;
input_setter.reset();
}
void ConfigureInput::keyPressEvent(QKeyEvent* event) {

View file

@ -1,4 +1,4 @@
// Copyright 2016 Citra Emulator Project
// Copyright 2016 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@ -7,11 +7,11 @@
#include <array>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <QKeyEvent>
#include <QWidget>
#include <boost/optional.hpp>
#include "common/param_package.h"
#include "core/settings.h"
#include "input_common/main.h"
@ -42,7 +42,7 @@ private:
std::unique_ptr<QTimer> poll_timer;
/// This will be the the setting function when an input is awaiting configuration.
boost::optional<std::function<void(const Common::ParamPackage&)>> input_setter;
std::optional<std::function<void(const Common::ParamPackage&)>> input_setter;
std::array<Common::ParamPackage, Settings::NativeButton::NumButtons> buttons_param;
std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs> analogs_param;