Skip to content

Commit

Permalink
added noexcept identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
karasikov committed Mar 16, 2021
1 parent ac51b61 commit 28efb9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 86 deletions.
8 changes: 4 additions & 4 deletions include/sdsl/int_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1205,7 +1205,7 @@ inline int_vector<t_width>::int_vector(size_type size, value_type default_value,
}

template<uint8_t t_width>
inline int_vector<t_width>::int_vector(int_vector&& v) :
inline int_vector<t_width>::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
Expand Down Expand Up @@ -1241,7 +1241,7 @@ int_vector<t_width>& int_vector<t_width>::operator=(const int_vector& v)
}

template<uint8_t t_width>
int_vector<t_width>& int_vector<t_width>::operator=(int_vector&& v)
int_vector<t_width>& int_vector<t_width>::operator=(int_vector&& v) noexcept
{
swap(v);
return *this;
Expand Down
41 changes: 1 addition & 40 deletions include/sdsl/rrr_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*!
Expand Down Expand Up @@ -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
{
Expand Down
43 changes: 1 addition & 42 deletions include/sdsl/rrr_vector_15.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*!
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 28efb9e

Please sign in to comment.