dense_set: constrain the allocator type

This commit is contained in:
Michele Caini
2022-02-28 23:07:29 +01:00
parent db680f3bcd
commit 2fbeeafbb8

View File

@@ -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>>;