We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fa946c commit 6610f5bCopy full SHA for 6610f5b
include/boost/dynamic_bitset/impl/dynamic_bitset.ipp
@@ -750,8 +750,13 @@ void
750
dynamic_bitset< Block, AllocatorOrContainer >::
751
push_back( bool bit )
752
{
753
- const size_type sz = size();
754
- resize( sz + 1, bit );
+ const int extra_bits = count_extra_bits();
+ if ( extra_bits == 0 ) {
755
+ m_bits.push_back( Block( bit ) );
756
+ } else {
757
+ m_bits.back() |= ( Block( bit ) << extra_bits );
758
+ }
759
+ ++ m_num_bits;
760
}
761
762
template< typename Block, typename AllocatorOrContainer >
0 commit comments