Skip to content

Commit a9cd6c3

Browse files
committed
fix -Wdeprecated-copy warnings in string algorithms
1 parent 2a05506 commit a9cd6c3

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

Diff for: include/boost/algorithm/string/detail/find_iterator.hpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,26 @@ namespace boost {
4040
// Protected construction/destruction
4141

4242
// Default constructor
43-
find_iterator_base() {}
43+
BOOST_DEFAULTED_FUNCTION(find_iterator_base(), {})
44+
4445
// Copy construction
45-
find_iterator_base( const find_iterator_base& Other ) :
46+
BOOST_DEFAULTED_FUNCTION(find_iterator_base( const find_iterator_base& Other ), :
4647
m_Finder(Other.m_Finder) {}
48+
)
49+
50+
// Assignment
51+
BOOST_DEFAULTED_FUNCTION(find_iterator_base& operator=( const find_iterator_base& Other ), {
52+
m_Finder = Other.m_Finder;
53+
return *this;
54+
})
4755

4856
// Constructor
4957
template<typename FinderT>
5058
find_iterator_base( FinderT Finder, int ) :
5159
m_Finder(Finder) {}
5260

5361
// Destructor
54-
~find_iterator_base() {}
62+
BOOST_DEFAULTED_FUNCTION(~find_iterator_base(), {})
5563

5664
// Find operation
5765
match_type do_find(

Diff for: include/boost/algorithm/string/find_iterator.hpp

+27-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace boost {
7474
7575
\post eof()==true
7676
*/
77-
find_iterator() {}
77+
BOOST_DEFAULTED_FUNCTION(find_iterator(), {})
7878

7979
//! Copy constructor
8080
/*!
@@ -85,6 +85,18 @@ namespace boost {
8585
m_Match(Other.m_Match),
8686
m_End(Other.m_End) {}
8787

88+
//! Copy assignment
89+
/*!
90+
Assigns a copy of the find_iterator
91+
*/
92+
BOOST_DEFAULTED_FUNCTION(find_iterator& operator=( const find_iterator& Other ), {
93+
if (this == &Other) return *this;
94+
this->base_type::operator=(Other);
95+
m_Match = Other.m_Match;
96+
m_End = Other.m_End;
97+
return *this;
98+
})
99+
88100
//! Constructor
89101
/*!
90102
Construct new find_iterator for a given finder
@@ -248,6 +260,20 @@ namespace boost {
248260
m_bEof(Other.m_bEof)
249261
{}
250262

263+
//! Assignment operator
264+
/*!
265+
Assigns a copy of the split_iterator
266+
*/
267+
BOOST_DEFAULTED_FUNCTION(split_iterator& operator=( const split_iterator& Other ), {
268+
if (this == &Other) return *this;
269+
this->base_type::operator=(Other);
270+
m_Match = Other.m_Match;
271+
m_Next = Other.m_Next;
272+
m_End = Other.m_End;
273+
m_bEof = Other.m_bEof;
274+
return *this;
275+
})
276+
251277
//! Constructor
252278
/*!
253279
Construct new split_iterator for a given finder

0 commit comments

Comments
 (0)