TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ erase() [1/2]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
size_type nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >::erase ( const Key &  key)
inline

Definition at line 17651 of file json.hpp.

17652 {
17653 for (auto it = this->begin(); it != this->end(); ++it)
17654 {
17655 if (it->first == key)
17656 {
17657 // Since we cannot move const Keys, re-construct them in place
17658 for (auto next = it; ++next != this->end(); ++it)
17659 {
17660 it->~value_type(); // Destroy but keep allocation
17661 new (&*it) value_type{std::move(*next)};
17662 }
17663
17664 Container::pop_back();
17665 return 1;
17666 }
17667 }
17668
17669 return 0;
17670 }