Skip to content

Commit

Permalink
🚑 fixed #1319
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Oct 30, 2018
1 parent 856fc31 commit 8cee0e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
13 changes: 4 additions & 9 deletions include/nlohmann/detail/meta/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,10 @@ struct is_constructible_object_type_impl <
using object_t = typename BasicJsonType::object_t;

static constexpr bool value =
std::is_constructible<typename ConstructibleObjectType::key_type,
typename object_t::key_type>::value and
(std::is_same<typename object_t::mapped_type,
typename ConstructibleObjectType::mapped_type>::value or
(has_from_json<BasicJsonType,
typename ConstructibleObjectType::mapped_type>::value or
has_non_default_from_json <
BasicJsonType,
typename ConstructibleObjectType::mapped_type >::value));
(std::is_constructible<typename ConstructibleObjectType::key_type, typename object_t::key_type>::value and
std::is_same<typename object_t::mapped_type, typename ConstructibleObjectType::mapped_type>::value) or
(has_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type>::value or
has_non_default_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type >::value);
};

template <typename BasicJsonType, typename ConstructibleObjectType>
Expand Down
13 changes: 4 additions & 9 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,10 @@ struct is_constructible_object_type_impl <
using object_t = typename BasicJsonType::object_t;

static constexpr bool value =
std::is_constructible<typename ConstructibleObjectType::key_type,
typename object_t::key_type>::value and
(std::is_same<typename object_t::mapped_type,
typename ConstructibleObjectType::mapped_type>::value or
(has_from_json<BasicJsonType,
typename ConstructibleObjectType::mapped_type>::value or
has_non_default_from_json <
BasicJsonType,
typename ConstructibleObjectType::mapped_type >::value));
(std::is_constructible<typename ConstructibleObjectType::key_type, typename object_t::key_type>::value and
std::is_same<typename object_t::mapped_type, typename ConstructibleObjectType::mapped_type>::value) or
(has_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type>::value or
has_non_default_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type >::value);
};

template <typename BasicJsonType, typename ConstructibleObjectType>
Expand Down

0 comments on commit 8cee0e3

Please sign in to comment.