diff --git a/src/json.hpp b/src/json.hpp index f7101d14..7f17a555 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -372,7 +372,7 @@ contains a `mapped_type`, whereas `std::vector` fails the test. public: \ static constexpr bool value = \ std::is_integral()))>::value; \ - }; + } NLOHMANN_JSON_HAS_HELPER(mapped_type); NLOHMANN_JSON_HAS_HELPER(key_type); @@ -3113,7 +3113,6 @@ class basic_json // we cannot static_assert on T being non-const, because there is support // for get(), which is why we still need the uncvref static_assert(not std::is_reference::value, "get cannot be used with reference types, you might want to use get_ref"); - static_assert(not std::is_pointer::value, "get cannot be used with pointer types, you might want to use get_ptr"); static_assert(std::is_default_constructible::value, "Types must be DefaultConstructible when used with get"); U ret; @@ -3146,7 +3145,6 @@ class basic_json U get() const noexcept(noexcept(JSONSerializer::from_json(std::declval()))) { static_assert(not std::is_reference::value, "get cannot be used with reference types, you might want to use get_ref"); - static_assert(not std::is_pointer::value, "get cannot be used with pointer types, you might want to use get_ptr"); return JSONSerializer::from_json(*this); } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 65860c4d..8c670c90 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -372,7 +372,7 @@ contains a `mapped_type`, whereas `std::vector` fails the test. public: \ static constexpr bool value = \ std::is_integral()))>::value; \ - }; + } NLOHMANN_JSON_HAS_HELPER(mapped_type); NLOHMANN_JSON_HAS_HELPER(key_type); diff --git a/test/src/unit-udt.cpp b/test/src/unit-udt.cpp index 7c297190..98a60c34 100644 --- a/test/src/unit-udt.cpp +++ b/test/src/unit-udt.cpp @@ -348,7 +348,7 @@ TEST_CASE("adl_serializer specialization", "[udt]") json j = optPerson; CHECK(j.is_null()); - optPerson.reset(new udt::person{{42}, {"John Doe"}}); + optPerson.reset(new udt::person{{42}, {"John Doe"}, udt::country::russia}); j = optPerson; CHECK_FALSE(j.is_null()); @@ -357,7 +357,7 @@ TEST_CASE("adl_serializer specialization", "[udt]") SECTION("from_json") { - auto person = udt::person{{42}, {"John Doe"}}; + auto person = udt::person{{42}, {"John Doe"}, udt::country::russia}; json j = person; auto optPerson = j.get>();