Просмотр исходного кода

any: avoid using storage_type to compute in_situ

Michele Caini 3 лет назад
Родитель
Сommit
ee88cf16d1
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/entt/core/any.hpp

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

@@ -57,7 +57,7 @@ class basic_any {
     using vtable_type = const void *(const operation, const basic_any &, const void *);
 
     template<typename Type>
-    static constexpr bool in_situ = Len && alignof(Type) <= alignof(storage_type) && sizeof(Type) <= sizeof(storage_type) && std::is_nothrow_move_constructible_v<Type>;
+    static constexpr bool in_situ = Len && alignof(Type) <= Align && sizeof(Type) <= Len && std::is_nothrow_move_constructible_v<Type>;
 
     template<typename Type>
     static const void *basic_vtable([[maybe_unused]] const operation op, [[maybe_unused]] const basic_any &value, [[maybe_unused]] const void *other) {