Fix #105 ("Fix gcc -Wdeprecated-copy")

This commit is contained in:
Ion Gaztañaga
2019-03-05 12:15:42 +01:00
parent 2b3775985e
commit da21340323
5 changed files with 59 additions and 8 deletions
+12 -1
View File
@@ -96,6 +96,10 @@ class vec_iterator
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
Pointer m_ptr;
class nat;
typedef typename dtl::if_c< IsConst
, vec_iterator<Pointer, false>
, nat>::type nonconst_iterator;
public:
BOOST_CONTAINER_FORCEINLINE const Pointer &get_ptr() const BOOST_NOEXCEPT_OR_NOTHROW
@@ -116,10 +120,17 @@ class vec_iterator
: m_ptr() //Value initialization to achieve "null iterators" (N3644)
{}
BOOST_CONTAINER_FORCEINLINE vec_iterator(vec_iterator<Pointer, false> const& other) BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE vec_iterator(const vec_iterator& other) BOOST_NOEXCEPT_OR_NOTHROW
: m_ptr(other.get_ptr())
{}
BOOST_CONTAINER_FORCEINLINE vec_iterator(const nonconst_iterator &other) BOOST_NOEXCEPT_OR_NOTHROW
: m_ptr(other.get_ptr())
{}
BOOST_CONTAINER_FORCEINLINE vec_iterator & operator=(const vec_iterator& other) BOOST_NOEXCEPT_OR_NOTHROW
{ m_ptr = other.get_ptr(); return *this; }
//Pointer like operators
BOOST_CONTAINER_FORCEINLINE reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!m_ptr); return *m_ptr; }