Merge pull request #6118 from lrineau/Voronoi_diagram_2-fix_cpp20_warning-GF

Voronoi_diagram_2: fix C++20 warnings [-Wambiguous-reversed-operator]
This commit is contained in:
Laurent Rineau 2021-11-18 12:23:31 +01:00
commit f0ae53e9d0
2 changed files with 10 additions and 10 deletions

View File

@ -71,13 +71,13 @@ class Circulator_from_halfedge_adaptor
typename Base::pointer operator->() { return &cur_; } typename Base::pointer operator->() { return &cur_; }
typename Base::reference operator*() { return cur_; } typename Base::reference operator*() { return cur_; }
bool operator==(const Circulator& other) const { friend bool operator==(const Circulator& c, const Circulator& other) {
return cur_ == other.cur_; return c.cur_ == other.cur_;
} }
bool operator!=(const Circulator& other) const { friend bool operator!=(const Circulator& c, const Circulator& other) {
return cur_ != other.cur_; return c.cur_ != other.cur_;
} }
protected: protected:

View File

@ -85,13 +85,13 @@ class Iterator_adaptor_base
return tmp; return tmp;
} }
bool operator==(const Iterator& other) const { bool operator==(const Self& other) const {
if ( vda_ == nullptr ) { return other.vda_ == nullptr; } if ( vda_ == nullptr ) { return other.vda_ == nullptr; }
if ( other.vda_ == nullptr ) { return vda_ == nullptr; } if ( other.vda_ == nullptr ) { return vda_ == nullptr; }
return ( vda_ == other.vda_ && cur_ == other.cur_ ); return ( vda_ == other.vda_ && cur_ == other.cur_ );
} }
bool operator!=(const Iterator& other) const { bool operator!=(const Self& other) const {
return !(*this == other); return !(*this == other);
} }
@ -235,12 +235,12 @@ private:
return *this; return *this;
} }
bool operator==(const Self& other) const { friend bool operator==(const Self& i, const Self& other) {
return Base::operator==(other) && is_first_ == other.is_first_; return i.Base::operator==(other) && i.is_first_ == other.is_first_;
} }
bool operator!=(const Self& other) const { friend bool operator!=(const Self& i, const Self& other) {
return !(*this == other); return !(i == other);
} }
private: private: