Skip to content

Commit 74a2e2c

Browse files
committed
[FIX] ambiguous comparison operator
1 parent 18d5e3a commit 74a2e2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/sdsl/int_vector.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,17 +771,17 @@ class int_vector
771771
return ((*data1) & bits::lo_set[l]) == ((*data2) & bits::lo_set[l]);
772772
}
773773

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

787787
//! Inequality operator for two int_vectors.

0 commit comments

Comments
 (0)