diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 702878bf3..a200b55ff 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -2867,9 +2867,6 @@ class basic_json #ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015 and not std::is_same>::value -#endif -#if defined(JSON_HAS_STRING_VIEW) - and not std::is_same::value #endif and detail::is_detected::value , int >::type = 0 > diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index a3c889fb0..7c57a61bd 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -15649,9 +15649,6 @@ class basic_json #ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015 and not std::is_same>::value -#endif -#if defined(JSON_HAS_STRING_VIEW) - and not std::is_same::value #endif and detail::is_detected::value , int >::type = 0 > diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index 87a7233c1..254aceab4 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -51,20 +51,6 @@ using nlohmann::json; #include #endif -template -struct is_implicitly_convertible -{ - private: - template - static std::true_type test(decltype(&C::operator To)); - - template - static std::false_type test(...); - - public: - static constexpr bool value = std::is_same(nullptr))>::value; -}; - TEST_CASE("value conversion") { SECTION("get an object (explicit)") @@ -494,7 +480,8 @@ TEST_CASE("value conversion") #if defined(JSON_HAS_STRING_VIEW) SECTION("std::string_view") { - static_assert(!is_implicitly_convertible::value); + std::string_view s = j; + CHECK(json(s) == j); } #endif