Add a definition for the copy constructor of dynamic_bitset::reference

Reason: Implicit definition is deprecated, because the class has a
user-declared copy assignment operator.

This closes issue #62.
This commit is contained in:
Gennaro Prota
2025-07-07 12:50:06 +02:00
parent 2928206d63
commit da2768d346
2 changed files with 10 additions and 0 deletions

View File

@@ -187,6 +187,13 @@ public:
void operator&();
public:
//! Copy constructor.
//!
//! Constructs a `reference` which refers to the same bit as
//! `other`.
// -------------------------------------------------------------------
reference( const reference & other );
//! See the class description.
// -------------------------------------------------------------------
operator bool() const;

View File

@@ -24,6 +24,9 @@ dynamic_bitset< Block, Allocator >::reference::reference( block_type & b, int po
{
}
template< typename Block, typename Allocator >
dynamic_bitset< Block, Allocator >::reference::reference( const reference & other ) = default;
template< typename Block, typename Allocator >
dynamic_bitset< Block, Allocator >::reference::
operator bool() const