소스 검색

registry: drop [[deprecated]] functions

Michele Caini 3 년 전
부모
커밋
93651e46f5
3개의 변경된 파일5개의 추가작업 그리고 20개의 파일을 삭제
  1. 0 15
      src/entt/entity/registry.hpp
  2. 1 1
      test/entt/entity/organizer.cpp
  3. 4 4
      test/entt/entity/registry.cpp

+ 0 - 15
src/entt/entity/registry.hpp

@@ -164,11 +164,6 @@ class registry_context {
     using container_type = dense_map<key_type, mapped_type, identity>;
 
 public:
-    template<typename Type, typename... Args>
-    [[deprecated("Use ::emplace_as instead")]] Type &emplace_hint(const id_type id, Args &&...args) {
-        return emplace_as<Type>(id, std::forward<Args>(args)...);
-    }
-
     template<typename Type, typename... Args>
     Type &emplace_as(const id_type id, Args &&...args) {
         return any_cast<Type &>(ctx.try_emplace(id, std::in_place_type<Type>, std::forward<Args>(args)...).first->second);
@@ -195,16 +190,6 @@ public:
         return it != ctx.end() && it->second.type() == type_id<Type>() ? (ctx.erase(it), true) : false;
     }
 
-    template<typename Type>
-    [[deprecated("Use ::get instead")]] [[nodiscard]] const Type &at(const id_type id = type_id<Type>().hash()) const {
-        return get<Type>(id);
-    }
-
-    template<typename Type>
-    [[deprecated("Use ::get instead")]] [[nodiscard]] Type &at(const id_type id = type_id<Type>().hash()) {
-        return get<Type>(id);
-    }
-
     template<typename Type>
     [[nodiscard]] const Type &get(const id_type id = type_id<Type>().hash()) const {
         return any_cast<const Type &>(ctx.at(id));

+ 1 - 1
test/entt/entity/organizer.cpp

@@ -428,5 +428,5 @@ TEST(Organizer, ToArgsIntegrity) {
     auto graph = organizer.graph();
     graph[0u].callback()(graph[0u].data(), registry);
 
-    ASSERT_EQ(registry.ctx().at<std::size_t>(), 0u);
+    ASSERT_EQ(registry.ctx().get<std::size_t>(), 0u);
 }

+ 4 - 4
test/entt/entity/registry.cpp

@@ -126,8 +126,8 @@ TEST(Registry, Context) {
 
     ASSERT_EQ(ctx.emplace<const int>(0), 42);
     ASSERT_EQ(ctx.find<const int>(), cctx.find<int>());
-    ASSERT_EQ(ctx.at<int>(), cctx.at<const int>());
-    ASSERT_EQ(ctx.at<int>(), 42);
+    ASSERT_EQ(ctx.get<int>(), cctx.get<const int>());
+    ASSERT_EQ(ctx.get<int>(), 42);
 
     ASSERT_EQ(ctx.find<double>(), nullptr);
     ASSERT_EQ(cctx.find<double>(), nullptr);
@@ -139,8 +139,8 @@ TEST(Registry, Context) {
 
     ASSERT_EQ(ctx.insert_or_assign<const int>(0), 0);
     ASSERT_EQ(ctx.find<const int>(), cctx.find<int>());
-    ASSERT_EQ(ctx.at<int>(), cctx.at<const int>());
-    ASSERT_EQ(ctx.at<int>(), 0);
+    ASSERT_EQ(ctx.get<int>(), cctx.get<const int>());
+    ASSERT_EQ(ctx.get<int>(), 0);
 }
 
 TEST(Registry, ContextHint) {