diff options
Diffstat (limited to 'src/optional.h')
-rw-r--r-- | src/optional.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/optional.h b/src/optional.h index a382cd7b77..583c56eabd 100644 --- a/src/optional.h +++ b/src/optional.h @@ -1,26 +1,20 @@ -// Copyright (c) 2017-2019 The Bitcoin Core developers +// Copyright (c) 2017-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_OPTIONAL_H #define BITCOIN_OPTIONAL_H +#include <optional> #include <utility> -#include <boost/optional.hpp> - //! Substitute for C++17 std::optional +//! DEPRECATED use std::optional in new code. template <typename T> -using Optional = boost::optional<T>; - -//! Substitute for C++17 std::make_optional -template <typename T> -Optional<T> MakeOptional(bool condition, T&& value) -{ - return boost::make_optional(condition, std::forward<T>(value)); -} +using Optional = std::optional<T>; //! Substitute for C++17 std::nullopt -static auto& nullopt = boost::none; +//! DEPRECATED use std::nullopt in new code. +static auto& nullopt = std::nullopt; #endif // BITCOIN_OPTIONAL_H |