Skip to content

Commit

Permalink
copy and move assignment operators in dac_vector_dp<>
Browse files Browse the repository at this point in the history
  • Loading branch information
karasikov committed Apr 16, 2021
1 parent 448b350 commit f6f0e9b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/sdsl/dac_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,20 @@ class dac_vector_dp
this->swap(other);
}

dac_vector_dp& operator=(dac_vector_dp other) {
dac_vector_dp& operator=(dac_vector_dp&& other) {
this->swap(other);
return *this;
}

dac_vector_dp& operator=(const dac_vector_dp& other) {
m_size = other.m_size;
m_overflow = other.m_overflow;
m_overflow_rank = other.m_overflow_rank;
m_overflow_rank.set_vector(&m_overflow);
m_data = other.m_data;
m_offsets = other.m_offsets;
}

double cost(size_t n, size_t m) {
// FIXME(niklasb) this seems to work well for both plain and rrr, but
// can probably be improved
Expand Down Expand Up @@ -218,7 +227,7 @@ class dac_vector_dp
lvl--;
bit_sizes.push_back(b);
}
assert(bit_sizes.size() <= max_levels);
assert(bit_sizes.size() <= (unsigned int)max_levels);

size_t total_overflow_size = 0;
for (size_t i = 0; i < c.size(); ++i) {
Expand Down

0 comments on commit f6f0e9b

Please sign in to comment.