Skip to content

Commit

Permalink
[FIX] ambiguous comparison operator
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jul 21, 2023
1 parent 18d5e3a commit 74a2e2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/sdsl/int_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,17 +771,17 @@ class int_vector
return ((*data1) & bits::lo_set[l]) == ((*data2) & bits::lo_set[l]);
}

//! Equality operator for an arbitrary container.
//! Equality operator for two int_vectors.
/*! Note that this function is slow since it compares element by element
* and cannot compare the bit representations of the containers.
* Two containers are equal if
* - sizes are equal and
* - its elements are equal.
*/
template <class container>
friend bool operator==(int_vector<t_width> const & lhs, container const & rhs) noexcept
template <uint8_t t_width2>
bool operator==(int_vector<t_width2> const & v) const noexcept
{
return std::equal(lhs.begin(), lhs.end(), rhs.begin());
return (this->size() == v.size()) && std::equal(this->begin(), this->end(), v.begin());
}

//! Inequality operator for two int_vectors.
Expand Down

0 comments on commit 74a2e2c

Please sign in to comment.