Skip to content

Commit

Permalink
meta: drop useless key_only func on meta assoc containers
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 20, 2023
1 parent 74da36a commit ac3b80e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
11 changes: 0 additions & 11 deletions src/entt/meta/meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ class meta_associative_container {
mapped_type_node = &internal::resolve<typename Type::mapped_type>;
}

key_only_container = meta_associative_container_traits<Type>::key_only;
vtable = meta_associative_container_traits<Type>::basic_vtable;
storage = std::move(instance);
}

[[nodiscard]] inline bool key_only() const noexcept;
[[nodiscard]] inline meta_type key_type() const noexcept;
[[nodiscard]] inline meta_type mapped_type() const noexcept;
[[nodiscard]] inline meta_type value_type() const noexcept;
Expand All @@ -166,7 +164,6 @@ class meta_associative_container {

private:
const meta_ctx *ctx{};
bool key_only_container{};
internal::meta_type_node (*key_type_node)(const internal::meta_context &){};
internal::meta_type_node (*mapped_type_node)(const internal::meta_context &){};
internal::meta_type_node (*value_type_node)(const internal::meta_context &){};
Expand Down Expand Up @@ -1956,14 +1953,6 @@ inline meta_sequence_container::iterator meta_sequence_container::erase(iterator
return static_cast<bool>(storage);
}

/**
* @brief Returns true if a container is also key-only, false otherwise.
* @return True if the associative container is also key-only, false otherwise.
*/
[[nodiscard]] inline bool meta_associative_container::key_only() const noexcept {
return key_only_container;
}

/**
* @brief Returns the meta key type of a container.
* @return The meta key type of the a container.
Expand Down
6 changes: 0 additions & 6 deletions test/entt/meta/meta_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ TEST(MetaContainer, StdMap) {
auto view = any.as_associative_container();

ASSERT_TRUE(view);
ASSERT_FALSE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::resolve<char>());
ASSERT_EQ(view.value_type(), (entt::resolve<std::pair<const int, char>>()));
Expand Down Expand Up @@ -358,7 +357,6 @@ TEST(MetaContainer, StdSet) {
auto view = any.as_associative_container();

ASSERT_TRUE(view);
ASSERT_TRUE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::meta_type{});
ASSERT_EQ(view.value_type(), entt::resolve<int>());
Expand Down Expand Up @@ -405,7 +403,6 @@ TEST(MetaContainer, DenseMap) {
map.emplace(4, '3');

ASSERT_TRUE(view);
ASSERT_FALSE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::resolve<char>());
ASSERT_EQ(view.value_type(), (entt::resolve<std::pair<const int, char>>()));
Expand Down Expand Up @@ -453,7 +450,6 @@ TEST(MetaContainer, DenseSet) {
set.emplace(4);

ASSERT_TRUE(view);
ASSERT_TRUE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::meta_type{});
ASSERT_EQ(view.value_type(), entt::resolve<int>());
Expand Down Expand Up @@ -544,7 +540,6 @@ TEST(MetaContainer, ConstKeyValueAssociativeContainer) {
auto view = any.as_associative_container();

ASSERT_TRUE(view);
ASSERT_FALSE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::resolve<char>());
ASSERT_EQ(view.value_type(), (entt::resolve<std::pair<const int, char>>()));
Expand Down Expand Up @@ -587,7 +582,6 @@ TEST(MetaContainer, ConstKeyOnlyAssociativeContainer) {
auto view = any.as_associative_container();

ASSERT_TRUE(view);
ASSERT_TRUE(view.key_only());
ASSERT_EQ(view.key_type(), entt::resolve<int>());
ASSERT_EQ(view.mapped_type(), entt::meta_type{});
ASSERT_EQ(view.value_type(), (entt::resolve<int>()));
Expand Down

0 comments on commit ac3b80e

Please sign in to comment.