From 0f9ed11e99f98c8a099343fabc7c8a076e75ccb3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 8 Nov 2008 11:35:40 +0000 Subject: [PATCH] Turn operator== into a member function --- STL_Extension/include/CGAL/Nested_iterator.h | 42 ++++++-------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/STL_Extension/include/CGAL/Nested_iterator.h b/STL_Extension/include/CGAL/Nested_iterator.h index c587f55858c..c0209107baa 100644 --- a/STL_Extension/include/CGAL/Nested_iterator.h +++ b/STL_Extension/include/CGAL/Nested_iterator.h @@ -84,11 +84,6 @@ namespace CGALi { } -template class Nested_iterator; - -template -bool operator==(const Nested_iterator&, - const Nested_iterator&); template > @@ -200,8 +195,20 @@ public: return nested_it_.operator->(); } - friend bool operator==<>(const Self&, const Self&); + bool operator==(const Self& it2) const + { + // CGAL_precondition( it1.b_ == it2.b_ && it1.e_ == it2.e_ ); + + if ( this->base() != it2.base() ) { return false; } + return this->is_end() || ( this->nested_it_ == it2.nested_it_ ); + } + + bool operator!=(const Self& it2) const + { + return !(*this == it2); + } + protected: void copy_from(const Self& other) { @@ -216,29 +223,6 @@ protected: }; - - - -template -inline -bool operator==(const Nested_iterator& it1, - const Nested_iterator& it2) -{ - // CGAL_precondition( it1.b_ == it2.b_ && it1.e_ == it2.e_ ); - - if ( it1.base() != it2.base() ) { return false; } - return it1.is_end() || ( it1.nested_it_ == it2.nested_it_ ); -} - -template -inline -bool operator!=(const Nested_iterator& it1, - const Nested_iterator& it2) -{ - return !(it1 == it2); -} - - CGAL_END_NAMESPACE #endif // CGAL_NESTED_ITERATOR_H