mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-19 04:12:09 +00:00
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:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user