2019-12-30 22:39:22 +13:00
|
|
|
// Copyright (c) 2017-2019 The Bitcoin Core developers
|
2017-07-27 10:08:31 -04:00
|
|
|
// 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
|
|
|
|
|
2020-06-05 23:02:44 +02:00
|
|
|
#include <optional>
|
2019-01-30 13:28:41 +02:00
|
|
|
#include <utility>
|
|
|
|
|
2017-07-27 10:08:31 -04:00
|
|
|
//! Substitute for C++17 std::optional
|
2020-06-05 23:02:44 +02:00
|
|
|
//! DEPRECATED use std::optional in new code.
|
2017-07-27 10:08:31 -04:00
|
|
|
template <typename T>
|
2020-06-05 23:02:44 +02:00
|
|
|
using Optional = std::optional<T>;
|
2017-07-27 10:08:31 -04:00
|
|
|
|
|
|
|
//! Substitute for C++17 std::nullopt
|
2020-06-05 23:02:44 +02:00
|
|
|
//! DEPRECATED use std::nullopt in new code.
|
|
|
|
static auto& nullopt = std::nullopt;
|
2017-07-27 10:08:31 -04:00
|
|
|
|
|
|
|
#endif // BITCOIN_OPTIONAL_H
|