Add missing operator== overloads for direct list_iterator comparisons

This commit is contained in:
LeonineKing1199
2021-11-18 10:19:46 -08:00
parent 2d69c7a5ca
commit d0d4be9e35

View File

@ -113,6 +113,10 @@ namespace test {
ptr_ = ptr_->next_; ptr_ = ptr_->next_;
return tmp; return tmp;
} }
bool operator==(list_iterator y) const { return ptr_ == y.ptr_; }
bool operator!=(list_iterator y) const { return ptr_ != y.ptr_; }
bool operator==(const_iterator y) const { return ptr_ == y.ptr_; } bool operator==(const_iterator y) const { return ptr_ == y.ptr_; }
bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; } bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; }
}; };