Skip to content

Commit

Permalink
meta: drop redundant function in the meta associative container
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 18, 2023
1 parent e73e0a9 commit 49c26c1
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/entt/meta/meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ class meta_associative_container {
inline bool reserve(const size_type);
[[nodiscard]] inline iterator begin();
[[nodiscard]] inline iterator end();
inline bool insert(meta_any);
inline bool insert(meta_any, meta_any);
inline size_type erase(meta_any);
[[nodiscard]] inline iterator find(meta_any);
Expand Down Expand Up @@ -2019,21 +2018,12 @@ inline bool meta_associative_container::reserve(const size_type sz) {
}

/**
* @brief Inserts a key only element into a container.
* @brief Inserts a key-only or key/value element into a container.
* @param key The key of the element to insert.
* @param value The value of the element to insert, if needed.
* @return A bool denoting whether the insertion took place.
*/
inline bool meta_associative_container::insert(meta_any key) {
return ((storage.policy() != any_policy::cref) && vtable(operation::insert, *ctx, storage.data(), &key, nullptr, nullptr));
}

/**
* @brief Inserts a key/value element into a container.
* @param key The key of the element to insert.
* @param value The value of the element to insert.
* @return A bool denoting whether the insertion took place.
*/
inline bool meta_associative_container::insert(meta_any key, meta_any value) {
inline bool meta_associative_container::insert(meta_any key, meta_any value = {}) {
return ((storage.policy() != any_policy::cref) && vtable(operation::insert, *ctx, storage.data(), &key, &value, nullptr));
}

Expand Down

0 comments on commit 49c26c1

Please sign in to comment.