Assert that Block is the same type as AllocatorOrContainer::value_type

Reason: That's required both when AllocatorOrContainer is an allocator
type and when it's a container type. Now, when it is an allocator type,
the assert is usually in the implementation of std::vector, which we
use. But, when it's a container type, we need to assert that on our own.
This commit is contained in:
Gennaro Prota
2025-09-10 16:51:41 +02:00
parent b6a875976d
commit 526104dbe9

View File

@@ -26,6 +26,7 @@
#include "boost/static_assert.hpp"
#include <iosfwd>
#include <string>
#include <type_traits>
#include <vector>
#if defined( BOOST_DYNAMIC_BITSET_SPECIALIZE_STD_HASH )
@@ -81,6 +82,7 @@ template< typename Block, typename AllocatorOrContainer >
class dynamic_bitset
{
BOOST_STATIC_ASSERT( (bool)detail::dynamic_bitset_impl::allowed_block_type< Block >::value );
BOOST_STATIC_ASSERT( std::is_same< Block, typename AllocatorOrContainer::value_type >::value );
public:
//! The same type as `Block`.