Compare commits

..

4 Commits

Author SHA1 Message Date
Glen Fernandes
a08a5b55ee Merge develop to master 2022-09-12 08:08:15 -04:00
Glen Fernandes
05a83223e4 Merge pull request #41 from apolukhin/antoshkka/fix-deprecated-copy
fix deprecated-copy warnings
2021-12-11 08:59:12 -05:00
Glen Fernandes
6c5ebd98a0 Update defaulted operator style 2021-12-11 08:57:56 -05:00
Antony Polukhin
d99ba9ae43 fix deprecated-copy warnings 2021-12-11 12:26:43 +03:00
2 changed files with 13 additions and 7 deletions

View File

@@ -259,7 +259,10 @@ struct iterator
#endif // #if BOOST_CB_ENABLE_DEBUG
//! Assign operator.
iterator& operator = (const iterator& it) {
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
iterator& operator=(const iterator&) = default;
#else
iterator& operator=(const iterator& it) {
if (this == &it)
return *this;
#if BOOST_CB_ENABLE_DEBUG
@@ -269,6 +272,7 @@ struct iterator
m_it = it.m_it;
return *this;
}
#endif
// Random access iterator methods

View File

@@ -71,6 +71,11 @@ class InstanceCounter {
public:
InstanceCounter() { increment(); }
InstanceCounter(const InstanceCounter& y) { y.increment(); }
InstanceCounter& operator=(const InstanceCounter& y) {
decrement();
y.increment();
return *this;
}
~InstanceCounter() { decrement(); }
static int count() { return ms_count; }
private:
@@ -106,12 +111,9 @@ struct MyInputIterator {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
explicit MyInputIterator(const vector_iterator& it) : m_it(it) {}
MyInputIterator& operator = (const MyInputIterator& it) {
if (this == &it)
return *this;
m_it = it.m_it;
return *this;
}
// Default assignment operator
reference operator * () const { return *m_it; }
pointer operator -> () const { return &(operator*()); }
MyInputIterator& operator ++ () {