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

This commit is contained in:
Michele Caini
2021-08-01 10:51:48 +02:00
parent d63f9e1eff
commit 6fb5b25530

View File

@@ -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;