From cd7acc1dc5887aa254191d2103bbb2243f9c67ef Mon Sep 17 00:00:00 2001 From: Alexander Karzhenkov Date: Sun, 20 Dec 2020 19:40:36 +0500 Subject: [PATCH] Include in "nlohmann/json.hpp" when C++17 is used --- include/nlohmann/json.hpp | 4 ++++ single_include/nlohmann/json.hpp | 4 ++++ test/src/unit-conversions.cpp | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index a726d1adf..8c9bef03d 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -73,6 +73,10 @@ SOFTWARE. #include #include +#if defined(JSON_HAS_CPP_17) + #include +#endif + /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 88c8fa74d..9e6f6012d 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -16663,6 +16663,10 @@ template , } // namespace nlohmann +#if defined(JSON_HAS_CPP_17) + #include +#endif + /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index c71e230d9..16c4f798e 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -48,10 +48,6 @@ using nlohmann::json; #define JSON_HAS_CPP_14 #endif -#if defined(JSON_HAS_CPP_17) - #include -#endif - TEST_CASE("value conversion") { SECTION("get an object (explicit)")