diff --git a/include/sdsl/int_vector.hpp b/include/sdsl/int_vector.hpp index 682e49be..3e3fad5f 100644 --- a/include/sdsl/int_vector.hpp +++ b/include/sdsl/int_vector.hpp @@ -346,7 +346,7 @@ class int_vector } //! Move constructor. - int_vector(int_vector&& v); + int_vector(int_vector&& v) noexcept; //! Copy constructor. int_vector(const int_vector& v); @@ -494,7 +494,7 @@ class int_vector int_vector& operator=(const int_vector& v); //! Move assignment operator. - int_vector& operator=(int_vector&& v); + int_vector& operator=(int_vector&& v) noexcept; //! Equality operator for two int_vectors. /*! Two int_vectors are equal if @@ -1205,7 +1205,7 @@ inline int_vector::int_vector(size_type size, value_type default_value, } template -inline int_vector::int_vector(int_vector&& v) : +inline int_vector::int_vector(int_vector&& v) noexcept : m_size(v.m_size), m_data(v.m_data), m_width(v.m_width) { v.m_data = nullptr; // ownership of v.m_data now transferred @@ -1241,7 +1241,7 @@ int_vector& int_vector::operator=(const int_vector& v) } template -int_vector& int_vector::operator=(int_vector&& v) +int_vector& int_vector::operator=(int_vector&& v) noexcept { swap(v); return *this; diff --git a/include/sdsl/rrr_vector.hpp b/include/sdsl/rrr_vector.hpp index c82a3666..9a0c7e93 100644 --- a/include/sdsl/rrr_vector.hpp +++ b/include/sdsl/rrr_vector.hpp @@ -103,33 +103,10 @@ class rrr_vector int_vector<> m_btnrp; // Sample pointers into m_btnr. int_vector<> m_rank; // Sample rank values. - void copy(const rrr_vector& rrr) - { - m_size = rrr.m_size; - m_bt = rrr.m_bt; - m_btnr = rrr.m_btnr; - m_btnrp = rrr.m_btnrp; - m_rank = rrr.m_rank; - } - public: - const rac_type& bt = m_bt; - const bit_vector& btnr = m_btnr; //! Default constructor - rrr_vector() {}; - - //! Copy constructor - rrr_vector(const rrr_vector& rrr) - { - copy(rrr); - } - - //! Move constructor - rrr_vector(rrr_vector&& rrr) : m_size(std::move(rrr.m_size)), - m_bt(std::move(rrr.m_bt)), - m_btnr(std::move(rrr.m_btnr)), m_btnrp(std::move(rrr.m_btnrp)), - m_rank(std::move(rrr.m_rank)) {} + rrr_vector() {} //! Constructor /*! @@ -385,22 +362,6 @@ class rrr_vector return res; } - //! Assignment operator - rrr_vector& operator=(const rrr_vector& rrr) - { - if (this != &rrr) { - copy(rrr); - } - return *this; - } - - //! Move assignment operator - rrr_vector& operator=(rrr_vector&& rrr) - { - swap(rrr); - return *this; - } - //! Returns the size of the original bit vector. size_type size()const { diff --git a/include/sdsl/rrr_vector_15.hpp b/include/sdsl/rrr_vector_15.hpp index fa9e3f97..bc0806dc 100644 --- a/include/sdsl/rrr_vector_15.hpp +++ b/include/sdsl/rrr_vector_15.hpp @@ -156,34 +156,10 @@ class rrr_vector<15, t_rac, t_k> int_vector<> m_btnrp; // Sample pointers into m_btnr. int_vector<> m_rank; // Sample rank values. - void copy(const rrr_vector& rrr) - { - m_size = rrr.m_size; - m_bt = rrr.m_bt; - m_btnr = rrr.m_btnr; - m_btnrp = rrr.m_btnrp; - m_rank = rrr.m_rank; - } public: - const rac_type& bt = m_bt; - const bit_vector& btnr = m_btnr; //! Default constructor - /*! \param k Store rank samples and pointers each k-th blocks. - */ - rrr_vector() {}; - - //! Copy constructor - rrr_vector(const rrr_vector& rrr) - { - copy(rrr); - } - - //! Move constructor - rrr_vector(rrr_vector&& rrr) : m_size(std::move(rrr.m_size)), - m_bt(std::move(rrr.m_bt)), - m_btnr(std::move(rrr.m_btnr)), m_btnrp(std::move(rrr.m_btnrp)), - m_rank(std::move(rrr.m_rank)) {} + rrr_vector() {} //! Constructor /*! @@ -348,23 +324,6 @@ class rrr_vector<15, t_rac, t_k> return res; } - - //! Assignment operator - rrr_vector& operator=(const rrr_vector& rrr) - { - if (this != &rrr) { - copy(rrr); - } - return *this; - } - - //! Move assignment - rrr_vector& operator=(rrr_vector&& rrr) - { - swap(rrr); - return *this; - } - //! Returns the size of the original bit vector. size_type size()const {