Include <optional> if possible to check if we can use the feature (#309)
Fixes #303
This commit is contained in:
parent
c641241a87
commit
4a02ad94f4
@ -51,9 +51,14 @@ THE SOFTWARE.
|
|||||||
# include <regex>
|
# include <regex>
|
||||||
#endif // CXXOPTS_NO_REGEX
|
#endif // CXXOPTS_NO_REGEX
|
||||||
|
|
||||||
#ifdef __cpp_lib_optional
|
// Nonstandard before C++17, which is coincidentally what we also need for <optional>
|
||||||
#include <optional>
|
#ifdef __has_include
|
||||||
#define CXXOPTS_HAS_OPTIONAL
|
# if __has_include(<optional>)
|
||||||
|
# include <optional>
|
||||||
|
# ifdef __cpp_lib_optional
|
||||||
|
# define CXXOPTS_HAS_OPTIONAL
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus >= 201603L
|
#if __cplusplus >= 201603L
|
||||||
@ -1361,7 +1366,7 @@ namespace cxxopts
|
|||||||
{
|
{
|
||||||
return m_count;
|
return m_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CXXOPTS_NULL_DEREF_IGNORE)
|
#if defined(CXXOPTS_NULL_DEREF_IGNORE)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user