Explorar o código

registry: ::assure sets a constraint on the type

Michele Caini %!s(int64=6) %!d(string=hai) anos
pai
achega
53fa0d2fe8
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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()) {