Commit b53eb516030c45d551640a1c0af871458eafa123
Committed by
Henry Schreiner
1 parent
7e724c5c
Fix for experimental optional with optional #158
Showing
1 changed file
with
4 additions
and
1 deletions
include/CLI/Optional.hpp
| @@ -10,13 +10,16 @@ | @@ -10,13 +10,16 @@ | ||
| 10 | // [CLI11:verbatim] | 10 | // [CLI11:verbatim] |
| 11 | #ifdef __has_include | 11 | #ifdef __has_include |
| 12 | 12 | ||
| 13 | +// You can explicitly enable or disable support | ||
| 14 | +// by defining these to 1 or 0. | ||
| 13 | #if defined(CLI11_CPP17) && __has_include(<optional>) && \ | 15 | #if defined(CLI11_CPP17) && __has_include(<optional>) && \ |
| 14 | !defined(CLI11_STD_OPTIONAL) | 16 | !defined(CLI11_STD_OPTIONAL) |
| 15 | #define CLI11_STD_OPTIONAL 1 | 17 | #define CLI11_STD_OPTIONAL 1 |
| 16 | #endif | 18 | #endif |
| 17 | 19 | ||
| 18 | #if defined(CLI11_CPP14) && __has_include(<experimental/optional>) && \ | 20 | #if defined(CLI11_CPP14) && __has_include(<experimental/optional>) && \ |
| 19 | - !defined(CLI11_EXPERIMENTAL_OPTIONAL) | 21 | + !defined(CLI11_EXPERIMENTAL_OPTIONAL) \ |
| 22 | + && (!defined(CLI11_STD_OPTIONAL) || CLI11_STD_OPTIONAL != 0) | ||
| 20 | #define CLI11_EXPERIMENTAL_OPTIONAL 1 | 23 | #define CLI11_EXPERIMENTAL_OPTIONAL 1 |
| 21 | #endif | 24 | #endif |
| 22 | 25 |