diff --git a/include/CLI/Optional.hpp b/include/CLI/Optional.hpp index 1597da33..04f710b9 100644 --- a/include/CLI/Optional.hpp +++ b/include/CLI/Optional.hpp @@ -9,26 +9,31 @@ // [CLI11:verbatim] #ifdef __has_include -#if defined(CLI11_CPP17) && __has_include() -#include -#ifdef __cpp_lib_optional -#ifndef CLI11_STD_OPTIONAL + +#if defined(CLI11_CPP17) && __has_include() && \ + defined(__cpp_lib_optional) && !defined(CLI11_STD_OPTIONAL) #define CLI11_STD_OPTIONAL #endif -#endif -#endif -#if defined(CLI11_CPP14) && __has_include() -#include -#ifndef CLI11_EXPERIMENTAL_OPTIONAL + +#if defined(CLI11_CPP14) && __has_include() && \ + !defined(CLI11_EXPERIMENTAL_OPTIONAL) #define CLI11_EXPERIMENTAL_OPTIONAL #endif -#endif -#if __has_include() -#include -#ifndef CLI11_BOOST_OPTIONAL + +#if __has_include() && !defined(CLI11_BOOST_OPTIONAL) #define CLI11_BOOST_OPTIONAL #endif + #endif + +#ifdef CLI11_STD_OPTIONAL +#include +#endif +#ifdef CLI11_EXPERIMENTAL_OPTIONAL +#include +#endif +#ifdef CLI11_BOOST_OPTIONAL +#include #endif // [CLI11:verbatim]