diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index a4e4769e4..fda63c51b 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -59,57 +59,57 @@ class basic_any { template static const void *basic_vtable(const operation op, const basic_any &value, const void *other) { static_assert(!std::is_void_v && std::is_same_v>, Type>, "Invalid type"); - const Type *element = nullptr; + const Type *elem = nullptr; if constexpr(in_situ) { - element = (value.mode == any_policy::owner) ? reinterpret_cast(&value.storage) : static_cast(value.instance); + elem = (value.mode == any_policy::owner) ? reinterpret_cast(&value.storage) : static_cast(value.instance); } else { - element = static_cast(value.instance); + elem = static_cast(value.instance); } switch(op) { case operation::copy: if constexpr(std::is_copy_constructible_v) { - static_cast(const_cast(other))->initialize(*element); + static_cast(const_cast(other))->initialize(*elem); } break; case operation::move: if constexpr(in_situ) { if(value.mode == any_policy::owner) { - return ::new(&static_cast(const_cast(other))->storage) Type{std::move(*const_cast(element))}; + return ::new(&static_cast(const_cast(other))->storage) Type{std::move(*const_cast(elem))}; } } return (static_cast(const_cast(other))->instance = std::exchange(const_cast(value).instance, nullptr)); case operation::transfer: if constexpr(std::is_move_assignable_v) { - *const_cast(element) = std::move(*static_cast(const_cast(other))); + *const_cast(elem) = std::move(*static_cast(const_cast(other))); return other; } [[fallthrough]]; case operation::assign: if constexpr(std::is_copy_assignable_v) { - *const_cast(element) = *static_cast(other); + *const_cast(elem) = *static_cast(other); return other; } break; case operation::destroy: if constexpr(in_situ) { - element->~Type(); + elem->~Type(); } else if constexpr(std::is_array_v) { - delete[] element; + delete[] elem; } else { - delete element; + delete elem; } break; case operation::compare: if constexpr(!std::is_function_v && !std::is_array_v && is_equality_comparable_v) { - return *element == *static_cast(other) ? other : nullptr; + return *elem == *static_cast(other) ? other : nullptr; } else { - return (element == other) ? other : nullptr; + return (elem == other) ? other : nullptr; } case operation::get: - return element; + return elem; } return nullptr;