Ver Fonte

meta: minor changes

Michele Caini há 1 ano atrás
pai
commit
afb6bfc731
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      src/entt/meta/meta.hpp

+ 3 - 1
src/entt/meta/meta.hpp

@@ -167,7 +167,9 @@ class meta_any {
     using vtable_type = void(const internal::meta_traits op, const bool, const meta_any &, void *);
 
     template<typename Type>
-    static std::enable_if_t<std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, Type>> basic_vtable([[maybe_unused]] const internal::meta_traits req, [[maybe_unused]] const bool const_only, [[maybe_unused]] const meta_any &self, [[maybe_unused]] void *other) {
+    static void basic_vtable([[maybe_unused]] const internal::meta_traits req, [[maybe_unused]] const bool const_only, [[maybe_unused]] const meta_any &self, [[maybe_unused]] void *other) {
+        static_assert(std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, Type>, "Invalid type");
+
         if constexpr(is_meta_pointer_like_v<Type>) {
             if(req == internal::meta_traits::is_meta_pointer_like) {
                 if constexpr(std::is_function_v<typename std::pointer_traits<Type>::element_type>) {