Include <string_view> in "nlohmann/json.hpp" when C++17 is used
diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index a726d1a..8c9bef0 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp
@@ -73,6 +73,10 @@ #include <nlohmann/json_fwd.hpp> #include <nlohmann/ordered_map.hpp> +#if defined(JSON_HAS_CPP_17) + #include <string_view> +#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 88c8fa7..9e6f601 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp
@@ -16663,6 +16663,10 @@ } // namespace nlohmann +#if defined(JSON_HAS_CPP_17) + #include <string_view> +#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 c71e230..16c4f79 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp
@@ -48,10 +48,6 @@ #define JSON_HAS_CPP_14 #endif -#if defined(JSON_HAS_CPP_17) - #include <string_view> -#endif - TEST_CASE("value conversion") { SECTION("get an object (explicit)")