Sfoglia il codice sorgente

meta_any: internal change to avoid using data() if not needed

Michele Caini 1 anno fa
parent
commit
6b514c3e28
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/entt/meta/meta.hpp

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

@@ -173,7 +173,7 @@ class meta_any {
                 if constexpr(std::is_function_v<typename std::pointer_traits<Type>::element_type>) {
                 if constexpr(std::is_function_v<typename std::pointer_traits<Type>::element_type>) {
                     static_cast<meta_any *>(other)->emplace<Type>(*static_cast<const Type *>(self.data()));
                     static_cast<meta_any *>(other)->emplace<Type>(*static_cast<const Type *>(self.data()));
                 } else if constexpr(!std::is_void_v<std::remove_const_t<typename std::pointer_traits<Type>::element_type>>) {
                 } else if constexpr(!std::is_void_v<std::remove_const_t<typename std::pointer_traits<Type>::element_type>>) {
-                    using in_place_type = decltype(adl_meta_pointer_like<Type>::dereference(*static_cast<const Type *>(self.data())));
+                    using in_place_type = decltype(adl_meta_pointer_like<Type>::dereference(std::declval<const Type &>()));
 
 
                     if constexpr(std::is_constructible_v<bool, Type>) {
                     if constexpr(std::is_constructible_v<bool, Type>) {
                         if(const auto &pointer_like = *static_cast<const Type *>(self.data()); pointer_like) {
                         if(const auto &pointer_like = *static_cast<const Type *>(self.data()); pointer_like) {