Skip to content

Commit 6401b3b

Browse files
committed
fix: update single_include to match from_json change
1 parent 7973af7 commit 6401b3b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

single_include/nlohmann/json.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5219,14 +5219,10 @@ inline void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
52195219

52205220
ConstructibleObjectType ret;
52215221
const auto* inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
5222-
using value_type = typename ConstructibleObjectType::value_type;
5223-
std::transform(
5224-
inner_object->begin(), inner_object->end(),
5225-
std::inserter(ret, ret.begin()),
5226-
[](typename BasicJsonType::object_t::value_type const & p)
5222+
for (const auto& p : *inner_object)
52275223
{
5228-
return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
5229-
});
5224+
ret.emplace(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
5225+
}
52305226
obj = std::move(ret);
52315227
}
52325228

0 commit comments

Comments
 (0)