فهرست منبع

registry: ::assure sets a constraint on the type

Michele Caini 6 سال پیش
والد
کامیت
53fa0d2fe8
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      src/entt/entity/registry.hpp

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

@@ -186,6 +186,7 @@ class basic_registry {
 
     template<typename Component>
     const pool_handler<Component> & assure() const {
+        static_assert(std::is_same_v<Component, std::decay_t<Component>>);
         static std::size_t index{pools.size()};
 
         if(const auto length = pools.size(); !(index < length) || pools[index].type_id != type_info<Component>::id()) {