Compare commits

...

2 Commits

Author SHA1 Message Date
sehe
9b64641093 Add missing friend declaration
Fixes issue #100
2025-12-22 12:21:01 +01:00
Gennaro Prota
54c841d585 Exercise subtraction between iterators in the unit tests
Reason: This was missing. And we forgot a friend declaration for the
corresponding operator-(), which will be added with the next commit.
2025-12-22 11:53:06 +01:00
2 changed files with 4 additions and 0 deletions

View File

@@ -1440,6 +1440,8 @@ public:
friend BOOST_DYNAMIC_BITSET_CONSTEXPR20 bool operator==( const bit_iterator_base< Iter > & lhs, const bit_iterator_base< Iter > & rhs );
template< typename Iter >
friend BOOST_DYNAMIC_BITSET_CONSTEXPR20 bool operator<( const bit_iterator_base< Iter > & lhs, const bit_iterator_base< Iter > & rhs );
template< typename Iter >
friend BOOST_DYNAMIC_BITSET_CONSTEXPR20 difference_type operator-( const bit_iterator_base< Iter > & lhs, const bit_iterator_base< Iter > & rhs );
protected:
BOOST_DYNAMIC_BITSET_CONSTEXPR20 void increment();

View File

@@ -248,6 +248,8 @@ struct bitset_test
BOOST_TEST( *( 1 + b.begin() ) == b[ 1 ] );
BOOST_TEST( *( b.end() - 1 ) == b[ b.size() - 1 ] );
}
BOOST_TEST( b.end() - b.begin() == static_cast< std::ptrdiff_t >( b.size() ) );
}
static void