Explorar o código

dense_set: constrain the allocator type

Michele Caini %!s(int64=4) %!d(string=hai) anos
pai
achega
2fbeeafbb8
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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>>;