Ver Fonte

dense_set: constrain the allocator type

Michele Caini há 4 anos atrás
pai
commit
2fbeeafbb8
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      src/entt/container/dense_set.hpp

+ 1 - 0
src/entt/container/dense_set.hpp

@@ -231,6 +231,7 @@ class dense_set {
 
     using node_type = std::pair<std::size_t, Type>;
     using alloc_traits = std::allocator_traits<Allocator>;
+    static_assert(std::is_same_v<typename alloc_traits::value_type, Type>);
     using sparse_container_type = std::vector<std::size_t, typename alloc_traits::template rebind_alloc<std::size_t>>;
     using packed_container_type = std::vector<node_type, typename alloc_traits::template rebind_alloc<node_type>>;