From b53eb516030c45d551640a1c0af871458eafa123 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Mon, 3 Sep 2018 20:24:30 +0200 Subject: [PATCH] Fix for experimental optional with optional #158 --- include/CLI/Optional.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/CLI/Optional.hpp b/include/CLI/Optional.hpp index faaee366..b1084657 100644 --- a/include/CLI/Optional.hpp +++ b/include/CLI/Optional.hpp @@ -10,13 +10,16 @@ // [CLI11:verbatim] #ifdef __has_include +// You can explicitly enable or disable support +// by defining these to 1 or 0. #if defined(CLI11_CPP17) && __has_include() && \ !defined(CLI11_STD_OPTIONAL) #define CLI11_STD_OPTIONAL 1 #endif #if defined(CLI11_CPP14) && __has_include() && \ - !defined(CLI11_EXPERIMENTAL_OPTIONAL) + !defined(CLI11_EXPERIMENTAL_OPTIONAL) \ + && (!defined(CLI11_STD_OPTIONAL) || CLI11_STD_OPTIONAL != 0) #define CLI11_EXPERIMENTAL_OPTIONAL 1 #endif