Bläddra i källkod

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

Michele Caini 4 år sedan
förälder
incheckning
6fb5b25530
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      src/entt/core/any.hpp

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

@@ -47,7 +47,7 @@ class basic_any {
 
     template<typename Type>
     [[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);
         } else {
             return lhs == rhs;