Prefer std::optional over boost:optional:

Some of the boost::optionals must remain for now.  Both
boost::beast and SOCI have interfaces that require
boost::optional.
This commit is contained in:
Scott Schurr
2020-11-13 15:09:18 -08:00
committed by Nik Bougalis
parent 85307b29d0
commit 3b33318dc8
241 changed files with 1293 additions and 1248 deletions

View File

@@ -23,17 +23,20 @@
#include <ripple/core/ConfigSections.h>
#include <ripple/server/Server.h>
#include <ripple/server/Session.h>
#include <boost/asio.hpp>
#include <boost/beast/core/tcp_stream.hpp>
#include <boost/beast/ssl/ssl_stream.hpp>
#include <boost/optional.hpp>
#include <boost/utility/in_place_factory.hpp>
#include <chrono>
#include <stdexcept>
#include <test/jtx.h>
#include <test/jtx/CaptureLogs.h>
#include <test/jtx/envconfig.h>
#include <test/unit_test/SuiteJournal.h>
#include <boost/asio.hpp>
#include <boost/beast/core/tcp_stream.hpp>
#include <boost/beast/ssl/ssl_stream.hpp>
#include <boost/utility/in_place_factory.hpp>
#include <chrono>
#include <optional>
#include <stdexcept>
#include <thread>
namespace ripple {
@@ -49,19 +52,19 @@ public:
{
private:
boost::asio::io_service io_service_;
boost::optional<boost::asio::io_service::work> work_;
std::optional<boost::asio::io_service::work> work_;
std::thread thread_;
public:
TestThread()
: work_(boost::in_place(std::ref(io_service_)))
: work_(std::in_place, std::ref(io_service_))
, thread_([&]() { this->io_service_.run(); })
{
}
~TestThread()
{
work_ = boost::none;
work_.reset();
thread_.join();
}