diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h index 3b9e70873cb..cfe7e8cbaa8 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h @@ -31,13 +31,6 @@ CGAL_BEGIN_NAMESPACE -//-----------------------------------------------------------------------// -// Polygon_2_const_edge_circulator -//-----------------------------------------------------------------------// -// Ideally the class Polygon_2_const_edge_circulator would be a nested -// class of Polygon_2, but this leads to compiler problems with -// SGI C++ 4.0 with the iterator_category() function - template class Polygon_2; template @@ -136,7 +129,7 @@ class Polygon_2_const_edge_circulator { } Polygon_2_const_edge_circulator<_Traits, _Container> - operator+(difference_type n) + operator+(difference_type n) const { return Polygon_2_const_edge_circulator<_Traits, _Container>( this->container, first_vertex + n); @@ -149,7 +142,7 @@ class Polygon_2_const_edge_circulator { } Polygon_2_const_edge_circulator<_Traits, _Container> - operator-(difference_type n) + operator-(difference_type n) const { return Polygon_2_const_edge_circulator<_Traits, _Container>( this->container, first_vertex - n); @@ -157,37 +150,37 @@ class Polygon_2_const_edge_circulator { difference_type operator-( - const Polygon_2_const_edge_circulator<_Traits, _Container>& a) + const Polygon_2_const_edge_circulator<_Traits, _Container>& a) const { return first_vertex - a.first_vertex; } - Segment_2 operator[](int n) + Segment_2 operator[](int n) const { return *Polygon_2_const_edge_circulator<_Traits, _Container>( this->container, first_vertex+n); } bool operator<( - const Polygon_2_const_edge_circulator<_Traits, _Container>& a) + const Polygon_2_const_edge_circulator<_Traits, _Container>& a) const { return first_vertex < a.first_vertex; } bool operator>( - const Polygon_2_const_edge_circulator<_Traits, _Container>& a) + const Polygon_2_const_edge_circulator<_Traits, _Container>& a) const { return first_vertex > a.first_vertex; } bool operator<=( - const Polygon_2_const_edge_circulator<_Traits, _Container>& a) + const Polygon_2_const_edge_circulator<_Traits, _Container>& a) const { return first_vertex <= a.first_vertex; } bool operator>=( - const Polygon_2_const_edge_circulator<_Traits, _Container>& a) + const Polygon_2_const_edge_circulator<_Traits, _Container>& a) const { return first_vertex >= a.first_vertex; } @@ -229,4 +222,3 @@ value_type(const Polygon_2_const_edge_circulator<_Traits,_Container>&) CGAL_END_NAMESPACE #endif - diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h index 69d7c91c43f..a600409e8d4 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_iterator.h @@ -29,13 +29,6 @@ CGAL_BEGIN_NAMESPACE -//-----------------------------------------------------------------------// -// Polygon_2_edge_iterator -//-----------------------------------------------------------------------// -// Ideally the class Polygon_2_edge_iterator would be a nested class of -// Polygon_2, but this leads to compiler problems with SGI C++ 4.0 -// with the iterator_category() function - template class Polygon_2; template @@ -80,7 +73,7 @@ class Polygon_2_edge_iterator { return !(first_vertex == x.first_vertex); } - Segment_2 operator*() { + Segment_2 operator*() const { const_iterator second_vertex = first_vertex; ++second_vertex; if (second_vertex == container->end()) @@ -90,7 +83,7 @@ class Polygon_2_edge_iterator { return construct_segment_2(*first_vertex, *second_vertex); } - Polygon_2__Segment_ptr operator->() + Polygon_2__Segment_ptr operator->() const {return Polygon_2__Segment_ptr(operator*());} Polygon_2_edge_iterator& operator++() { @@ -123,7 +116,7 @@ class Polygon_2_edge_iterator { } Polygon_2_edge_iterator - operator+(difference_type n) { + operator+(difference_type n) const { return Polygon_2_edge_iterator( container, first_vertex + n); } @@ -134,37 +127,37 @@ class Polygon_2_edge_iterator { } Polygon_2_edge_iterator - operator-(difference_type n) { + operator-(difference_type n) const { return Polygon_2_edge_iterator( container, first_vertex - n); } difference_type - operator-(const Polygon_2_edge_iterator& a) { + operator-(const Polygon_2_edge_iterator& a) const { return first_vertex - a.first_vertex; } - Segment_2 operator[](int n) { + Segment_2 operator[](int n) const { return *Polygon_2_edge_iterator( container, first_vertex+n); } - bool operator<(const Polygon_2_edge_iterator& a) + bool operator<(const Polygon_2_edge_iterator& a) const { return first_vertex < a.first_vertex; } - bool operator>(const Polygon_2_edge_iterator& a) + bool operator>(const Polygon_2_edge_iterator& a) const { return first_vertex > a.first_vertex; } - bool operator<=(const Polygon_2_edge_iterator& a) + bool operator<=(const Polygon_2_edge_iterator& a) const { return first_vertex <= a.first_vertex; } - bool operator>=(const Polygon_2_edge_iterator& a) + bool operator>=(const Polygon_2_edge_iterator& a) const { return first_vertex >= a.first_vertex; } @@ -201,4 +194,3 @@ value_type(const Polygon_2_edge_iterator&) CGAL_END_NAMESPACE #endif -