Browse Source

sigh mixin: avoid nonsense warnings with g++

Michele Caini 1 year ago
parent
commit
fd3e275d86
1 changed files with 6 additions and 8 deletions
  1. 6 8
      src/entt/entity/mixin.hpp

+ 6 - 8
src/entt/entity/mixin.hpp

@@ -136,18 +136,16 @@ public:
           construction{allocator},
           construction{allocator},
           destruction{allocator},
           destruction{allocator},
           update{allocator} {
           update{allocator} {
-        using element_type = typename Type::element_type;
-
-        if constexpr(internal::has_on_construct<element_type, Registry>::value) {
-            entt::sink{construction}.template connect<&element_type::on_construct>();
+        if constexpr(internal::has_on_construct<typename underlying_type::element_type, Registry>::value) {
+            entt::sink{construction}.template connect<&underlying_type::element_type::on_construct>();
         }
         }
 
 
-        if constexpr(internal::has_on_update<element_type, Registry>::value) {
-            entt::sink{update}.template connect<&element_type::on_update>();
+        if constexpr(internal::has_on_update<typename underlying_type::element_type, Registry>::value) {
+            entt::sink{update}.template connect<&underlying_type::element_type::on_update>();
         }
         }
 
 
-        if constexpr(internal::has_on_destroy<element_type, Registry>::value) {
-            entt::sink{destruction}.template connect<&element_type::on_destroy>();
+        if constexpr(internal::has_on_destroy<typename underlying_type::element_type, Registry>::value) {
+            entt::sink{destruction}.template connect<&underlying_type::element_type::on_destroy>();
         }
         }
     }
     }