Просмотр исходного кода

meta: refine policy check on value types for non-member data

Michele Caini 2 лет назад
Родитель
Сommit
59abfbfb5a
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/entt/meta/factory.hpp

+ 6 - 1
src/entt/meta/factory.hpp

@@ -287,7 +287,12 @@ public:
             bucket = &elem.prop;
         } else {
             using data_type = std::remove_pointer_t<decltype(Data)>;
-            static_assert(Policy::template value<data_type>, "Invalid return type for the given policy");
+
+            if constexpr(std::is_pointer_v<decltype(Data)>) {
+                static_assert(Policy::template value<decltype(*Data)>, "Invalid return type for the given policy");
+            } else {
+                static_assert(Policy::template value<data_type>, "Invalid return type for the given policy");
+            }
 
             auto &&elem = internal::meta_extend(
                 internal::owner(*ctx, *info),