Skip to content

Dynamic bitset compilation broken in boost 1.90.0? #100

@bredelings

Description

@bredelings

The operator- on bit iterators fails to compile in boost v1.90. Could I be missing something here?

template< typename Iterator >
BOOST_DYNAMIC_BITSET_CONSTEXPR20 std::ptrdiff_t
                                 operator-( const bit_iterator_base< Iterator > & lhs, const bit_iterator_base< Iterator > & rhs )
{
    return ( lhs.m_block_iterator - rhs.m_block_iterator ) * bit_iterator_base< Iterator >::bits_per_block
         + lhs.m_bit_index - rhs.m_bit_index;
}

The error for gcc-15 looks like:

`/path/to/installed-boost-1.90.0/include/boost/dynamic_bitset/impl/dynamic_bitset.ipp:247:18: error: ‘__gnu_cxx::__normal_iterator<const long unsigned int*, std::vector<long unsigned int> > boost::bit_iterator_base<__gnu_cxx::__normal_iterator<const long unsigned int*, std::vector<long unsigned int> > >::m_block_iterator’ is protected within this context
  247 |     return ( lhs.m_block_iterator - rhs.m_block_iterator ) * bit_iterator_base< Iterator >::bits_per_block
      |              ~~~~^~~~~~~~~~~~~~~~
...

I'm not getting errors on operator== and operator<, but it looks like they may have the same issue.

Could this be fixed for boost v1.90.1?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions