diff --git a/source/cli/meojson/json.hpp b/source/cli/meojson/json.hpp index aed96186..41546ae4 100644 --- a/source/cli/meojson/json.hpp +++ b/source/cli/meojson/json.hpp @@ -306,6 +306,7 @@ class basic_array void clear() noexcept; bool erase(size_t pos); + bool erase(iterator iter); iterator begin() noexcept; iterator end() noexcept; @@ -419,6 +420,7 @@ class basic_object void clear() noexcept; bool erase(const string_t& key); + bool erase(iterator iter); iterator begin() noexcept; iterator end() noexcept; @@ -1367,7 +1369,13 @@ MEOJSON_INLINE void basic_array::clear() noexcept template MEOJSON_INLINE bool basic_array::erase(size_t pos) { - return _array_data.erase(pos) != _array_data.end(); + return erase(_array_data.begin() + pos); +} + +template +MEOJSON_INLINE bool basic_array::erase(iterator iter) +{ + return _array_data.erase(iter) != _array_data.end(); } template @@ -1693,6 +1701,12 @@ MEOJSON_INLINE bool basic_object::erase(const string_t& key) return _object_data.erase(key) > 0 ? true : false; } +template +MEOJSON_INLINE bool basic_object::erase(iterator iter) +{ + return _object_data.erase(iter) != _object_data.end(); +} + template template MEOJSON_INLINE decltype(auto) basic_object::emplace(args_t&&... args)