From 2d483142a7051389afe74c57a216843e6306f1a8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 30 Jan 2019 13:28:41 +0200 Subject: Remove 'boost::optional'-related gcc warnings --- src/optional.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/optional.h') diff --git a/src/optional.h b/src/optional.h index 1614c89718..95a3b24d0a 100644 --- a/src/optional.h +++ b/src/optional.h @@ -5,12 +5,21 @@ #ifndef BITCOIN_OPTIONAL_H #define BITCOIN_OPTIONAL_H +#include + #include //! Substitute for C++17 std::optional template using Optional = boost::optional; +//! Substitute for C++17 std::make_optional +template +Optional MakeOptional(bool condition, T&& value) +{ + return boost::make_optional(condition, std::forward(value)); +} + //! Substitute for C++17 std::nullopt static auto& nullopt = boost::none; -- cgit v1.2.3