diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index eb4b2b790b..8f83341f48 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -13,6 +13,9 @@ #include // forward_list #include // inserter, front_inserter, end #include // map +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif #include // string #include // tuple, make_tuple #include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible @@ -20,6 +23,7 @@ #include // pair, declval #include // valarray + #include #include #include diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp index 641d5d0258..18c4493e75 100644 --- a/include/nlohmann/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp @@ -10,6 +10,9 @@ #include // copy #include // begin, end +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif #include // string #include // tuple, get #include // is_same, is_constructible, is_floating_point, is_enum, underlying_type diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index db29a7b51f..be31fd88cb 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -47,10 +47,6 @@ #define JSON_HAS_CPP_11 #endif -#ifdef JSON_HAS_CPP_17 - #include -#endif - #ifdef __has_include #if __has_include() #include diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f4a5edd6d9..123d106f18 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -162,6 +162,9 @@ #include // forward_list #include // inserter, front_inserter, end #include // map +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif #include // string #include // tuple, make_tuple #include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible @@ -169,6 +172,7 @@ #include // pair, declval #include // valarray + // #include // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ @@ -2505,10 +2509,6 @@ JSON_HEDLEY_DIAGNOSTIC_POP #define JSON_NO_UNIQUE_ADDRESS #endif -#ifdef JSON_HAS_CPP_17 - #include -#endif - // disable documentation warnings on clang #if defined(__clang__) #pragma clang diagnostic push @@ -5184,6 +5184,9 @@ NLOHMANN_JSON_NAMESPACE_END #include // copy #include // begin, end +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif #include // string #include // tuple, get #include // is_same, is_constructible, is_floating_point, is_enum, underlying_type