Browse Source

*: minor changes

Michele Caini 5 years ago
parent
commit
8cb61da9c2

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

@@ -85,7 +85,7 @@ class poly_vtable {
             };
             };
         } else {
         } else {
             entry = +[](Any &any, Args... args) -> Ret {
             entry = +[](Any &any, Args... args) -> Ret {
-                return std::invoke(Candidate, any_cast<constness_as_t<Type, Any> &>(any), std::forward<Args>(args)...);
+                return static_cast<Ret>(std::invoke(Candidate, any_cast<constness_as_t<Type, Any> &>(any), std::forward<Args>(args)...));
             };
             };
         }
         }
     }
     }

+ 3 - 3
src/entt/signal/delegate.hpp

@@ -100,7 +100,7 @@ class delegate<Ret(Args...)> {
     [[nodiscard]] auto wrap(std::index_sequence<Index...>) ENTT_NOEXCEPT {
     [[nodiscard]] auto wrap(std::index_sequence<Index...>) ENTT_NOEXCEPT {
         return [](const void *, Args... args) -> Ret {
         return [](const void *, Args... args) -> Ret {
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
-            return Ret(std::invoke(Candidate, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
+            return static_cast<Ret>(std::invoke(Candidate, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
         };
         };
     }
     }
 
 
@@ -109,7 +109,7 @@ class delegate<Ret(Args...)> {
         return [](const void *payload, Args... args) -> Ret {
         return [](const void *payload, Args... args) -> Ret {
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
             Type *curr = static_cast<Type *>(const_cast<constness_as_t<void, Type> *>(payload));
             Type *curr = static_cast<Type *>(const_cast<constness_as_t<void, Type> *>(payload));
-            return Ret(std::invoke(Candidate, *curr, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
+            return static_cast<Ret>(std::invoke(Candidate, *curr, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
         };
         };
     }
     }
 
 
@@ -118,7 +118,7 @@ class delegate<Ret(Args...)> {
         return [](const void *payload, Args... args) -> Ret {
         return [](const void *payload, Args... args) -> Ret {
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
             [[maybe_unused]] const auto arguments = std::forward_as_tuple(std::forward<Args>(args)...);
             Type *curr = static_cast<Type *>(const_cast<constness_as_t<void, Type> *>(payload));
             Type *curr = static_cast<Type *>(const_cast<constness_as_t<void, Type> *>(payload));
-            return Ret(std::invoke(Candidate, curr, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
+            return static_cast<Ret>(std::invoke(Candidate, curr, std::forward<type_list_element_t<Index, type_list<Args...>>>(std::get<Index>(arguments))...));
         };
         };
     }
     }
 
 

+ 1 - 1
test/entt/meta/meta_type.cpp

@@ -68,7 +68,7 @@ struct overloaded_func_t {
 
 
     float f(int a, float b) {
     float f(int a, float b) {
         value = a;
         value = a;
-        return e(b);
+        return static_cast<float>(e(static_cast<int>(b)));
     }
     }
 
 
     int g(int v) const {
     int g(int v) const {

+ 1 - 1
test/entt/poly/poly_deduced.cpp

@@ -11,7 +11,7 @@ struct Deduced: entt::type_list<> {
         void set(int v) { entt::poly_call<1>(*this, v); }
         void set(int v) { entt::poly_call<1>(*this, v); }
         int get() const { return entt::poly_call<2>(*this); }
         int get() const { return entt::poly_call<2>(*this); }
         void decr() { entt::poly_call<3>(*this); }
         void decr() { entt::poly_call<3>(*this); }
-        int mul(int v) const { return entt::poly_call<4>(*this, v); }
+        int mul(int v) const { return static_cast<int>(entt::poly_call<4>(*this, v)); }
     };
     };
 
 
     template<typename Type>
     template<typename Type>