From 0ca460971e898a1f34dee3eb8ee538dbfdc43daf Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Wed, 10 Sep 2025 11:19:05 +0200 Subject: [PATCH] Make buffer_type public Reason: Failures from GCC and Clang. See the new code comment. --- doc/mrdocs.yml | 1 + include/boost/dynamic_bitset/dynamic_bitset.hpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/mrdocs.yml b/doc/mrdocs.yml index ee42b18..cb66015 100644 --- a/doc/mrdocs.yml +++ b/doc/mrdocs.yml @@ -16,6 +16,7 @@ exclude-symbols: - 'boost::detail::**' - 'boost::to_string_helper' - 'boost::dynamic_bitset::bit_appender' + - 'boost::dynamic_bitset::buffer_type' file-patterns: - '*.hpp' multipage: true diff --git a/include/boost/dynamic_bitset/dynamic_bitset.hpp b/include/boost/dynamic_bitset/dynamic_bitset.hpp index d8b404a..b0c8674 100644 --- a/include/boost/dynamic_bitset/dynamic_bitset.hpp +++ b/include/boost/dynamic_bitset/dynamic_bitset.hpp @@ -84,11 +84,6 @@ template< typename Block, typename AllocatorOrContainer > class dynamic_bitset { BOOST_STATIC_ASSERT( (bool)detail::dynamic_bitset_impl::allowed_block_type< Block >::value ); - typedef typename std::conditional< - detail::dynamic_bitset_impl::is_container< AllocatorOrContainer, Block >::value, - AllocatorOrContainer, - std::vector< Block, AllocatorOrContainer > - >::type buffer_type; public: //! The same type as `Block`. @@ -105,6 +100,16 @@ public: // ----------------------------------------------------------------------- typedef std::size_t size_type; + //! Note: Made public to cope with failures from many GCC and + //! Clang versions which seem to ignore the friend declarations + //! of `bit_iterator` and `const_bit_iterator`. + // ----------------------------------------------------------------------- + typedef typename std::conditional< + detail::dynamic_bitset_impl::is_container< AllocatorOrContainer, Block >::value, + AllocatorOrContainer, + std::vector< Block, AllocatorOrContainer > + >::type buffer_type; + //! The number of bits the type `Block` uses to represent //! values, excluding any padding bits. Numerically equal to //! `std::numeric_limits< Block >::digits`.