Skip to content

Commit

Permalink
chore: 更新meojson版本
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 19, 2023
1 parent 0888dff commit 5fe757e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion source/cli/meojson/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1367,7 +1369,13 @@ MEOJSON_INLINE void basic_array<string_t>::clear() noexcept
template <typename string_t>
MEOJSON_INLINE bool basic_array<string_t>::erase(size_t pos)
{
return _array_data.erase(pos) != _array_data.end();
return erase(_array_data.begin() + pos);
}

template <typename string_t>
MEOJSON_INLINE bool basic_array<string_t>::erase(iterator iter)
{
return _array_data.erase(iter) != _array_data.end();
}

template <typename string_t>
Expand Down Expand Up @@ -1693,6 +1701,12 @@ MEOJSON_INLINE bool basic_object<string_t>::erase(const string_t& key)
return _object_data.erase(key) > 0 ? true : false;
}

template <typename string_t>
MEOJSON_INLINE bool basic_object<string_t>::erase(iterator iter)
{
return _object_data.erase(iter) != _object_data.end();
}

template <typename string_t>
template <typename... args_t>
MEOJSON_INLINE decltype(auto) basic_object<string_t>::emplace(args_t&&... args)
Expand Down

0 comments on commit 5fe757e

Please sign in to comment.