Subject: CGAL users discussion list
List archive
- From: Roger House <>
- To:
- Subject: Re: [cgal-discuss] iterator_distance won't compile
- Date: Thu, 25 Sep 2008 12:48:13 -0700
Sylvain:
Thank you for your reply. I looked at Polygon_2_edge_iterator.h, but I don't see where
"const" might be inserted. Below is an excerpt from that file which would seem to be the place to make changes. If you can make the required changes in a reply, I will see if they fix the iterator_distance problem.
Thank you,
Roger House
// random access iterator requirements
Polygon_2_edge_iterator<Traits_, Container_>&
operator+=(difference_type n) {
first_vertex += n;
return *this;
}
Polygon_2_edge_iterator<Traits_, Container_>
operator+(difference_type n) {
return Polygon_2_edge_iterator<Traits_, Container_>(
container, first_vertex + n);
}
Polygon_2_edge_iterator<Traits_, Container_>&
operator-=(difference_type n) {
return (*this) -= n;
}
Polygon_2_edge_iterator<Traits_, Container_>
operator-(difference_type n) {
return Polygon_2_edge_iterator<Traits_, Container_>(
container, first_vertex - n);
}
difference_type
operator-(const Polygon_2_edge_iterator<Traits_, Container_>& a) {
return first_vertex - a.first_vertex;
}
Sylvain Pion wrote:
Roger House a écrit :
I have not been able to get this expression to compile with MSVC++
iterator_distance(P.edges_begin(), I)
where both operands are of type Polygon_2::Edge_const_iterator. The comment
in the code below shows the compiler error message. The attached file
contains the entire error message with all its gory details.
It seems that two iterators of the same type which point to the same object
should be acceptable to iterator_distance, but perhaps I fail to understand
something. Any help will be appreciated.
Having a quick look, it seems that some "const" are missing in
<CGAL/Polygon_2/Polygon_2_edge_iterator.h>, in the operator+ and operator-
(and other) member functions of the Polygon_2_edge_iterator class.
Could you try adding them and report back?
- [cgal-discuss] iterator_distance won't compile, Roger House, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Sylvain Pion, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Roger House, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Sylvain Pion, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Roger House, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Sylvain Pion, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Roger House, 09/25/2008
- Re: [cgal-discuss] iterator_distance won't compile, Sylvain Pion, 09/25/2008
Archive powered by MHonArc 2.6.16.