1
0
Эх сурвалжийг харах

any: don't compare arrays directly (operator== even deprecated in C++20)

Michele Caini 4 жил өмнө
parent
commit
6fb5b25530

+ 1 - 1
src/entt/core/any.hpp

@@ -47,7 +47,7 @@ class basic_any {
 
 
     template<typename Type>
     template<typename Type>
     [[nodiscard]] static bool compare(const void *lhs, const void *rhs) {
     [[nodiscard]] static bool compare(const void *lhs, const void *rhs) {
-        if constexpr(!std::is_function_v<Type> && is_equality_comparable_v<Type>) {
+        if constexpr(!std::is_function_v<Type> && !std::is_array_v<Type> && is_equality_comparable_v<Type>) {
             return *static_cast<const Type *>(lhs) == *static_cast<const Type *>(rhs);
             return *static_cast<const Type *>(lhs) == *static_cast<const Type *>(rhs);
         } else {
         } else {
             return lhs == rhs;
             return lhs == rhs;