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 | 10 | // [CLI11:verbatim] |
| 11 | 11 | #ifdef __has_include |
| 12 | 12 | |
| 13 | +// You can explicitly enable or disable support | |
| 14 | +// by defining these to 1 or 0. | |
| 13 | 15 | #if defined(CLI11_CPP17) && __has_include(<optional>) && \ |
| 14 | 16 | !defined(CLI11_STD_OPTIONAL) |
| 15 | 17 | #define CLI11_STD_OPTIONAL 1 |
| 16 | 18 | #endif |
| 17 | 19 | |
| 18 | 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 | 23 | #define CLI11_EXPERIMENTAL_OPTIONAL 1 |
| 21 | 24 | #endif |
| 22 | 25 | ... | ... |