TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ from_json() [9/19]

template<typename BasicJsonType , typename Key , typename Value , typename Compare , typename Allocator , typename = enable_if_t < !std::is_constructible < typename BasicJsonType::string_t, Key >::value >>
void nlohmann::detail::from_json ( const BasicJsonType &  j,
std::map< Key, Value, Compare, Allocator > &  m 
)

Definition at line 4288 of file json.hpp.

4289{
4290 if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4291 {
4292 JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4293 }
4294
4295 m.clear();
4296
4297 for (const auto &p : j)
4298 {
4299 if (JSON_HEDLEY_UNLIKELY(!p.is_array()))
4300 {
4301 JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()), j));
4302 }
4303
4304 m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
4305 }
4306}