4172{
4173 if (JSON_HEDLEY_UNLIKELY(!j.is_object()))
4174 {
4175 JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()), j));
4176 }
4177
4178 ConstructibleObjectType ret;
4179 const auto *inner_object = j.template get_ptr<const typename BasicJsonType::object_t *>();
4180 using value_type = typename ConstructibleObjectType::value_type;
4181 std::transform(
4182 inner_object->begin(), inner_object->end(),
4183 std::inserter(ret, ret.begin()),
4184 [](typename BasicJsonType::object_t::value_type const & p)
4185 {
4186 return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
4187 });
4188 obj = std::move(ret);
4189}