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

storage: exploit std::allocator<void> cross constructors

skypjack 3 месяцев назад
Родитель
Сommit
13a479eff0
1 измененных файлов с 1 добавлено и 6 удалено
  1. 1 6
      src/entt/entity/storage.hpp

+ 1 - 6
src/entt/entity/storage.hpp

@@ -867,12 +867,7 @@ public:
      * @return The associated allocator.
      */
     [[nodiscard]] constexpr allocator_type get_allocator() const noexcept {
-        // std::allocator<void> has no cross constructors (waiting for C++20)
-        if constexpr(std::is_void_v<element_type> && !std::is_constructible_v<allocator_type, typename base_type::allocator_type>) {
-            return allocator_type{};
-        } else {
-            return allocator_type{base_type::get_allocator()};
-        }
+        return allocator_type{base_type::get_allocator()};
     }
 
     /**