dogecoin/src/optional.h
MarcoFalke aaaaad6ac9
scripted-diff: Bump copyright of files changed in 2019
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2019-12-30 10:42:20 +13:00

27 lines
695 B
C++

// Copyright (c) 2017-2019 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 <utility>
#include <boost/optional.hpp>
//! Substitute for C++17 std::optional
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));
}
//! Substitute for C++17 std::nullopt
static auto& nullopt = boost::none;
#endif // BITCOIN_OPTIONAL_H