Merge branch 'Polygon_2-patch_from_a_user-lrineau'

All Polygon_2::erase() overloads now return an iterator or a circulator,
to make them more convenient (and STL-like).

That patch is a non-significant contribution (as regard the owernship of
code) from a CGAL-discuss user.

Tested in CGAL-4.4.-Ic-91.
This commit is contained in:
Laurent Rineau 2014-01-22 11:34:58 +01:00
commit b8f76c4f63
1 changed files with 11 additions and 6 deletions

View File

@ -212,16 +212,21 @@ class Polygon_2 {
{ d_container.insert(d_container.end(), x); }
/// Erases the vertex pointed to by `i`.
void erase(Vertex_iterator i)
{ d_container.erase(i); }
Vertex_iterator erase(Vertex_iterator i)
{
return d_container.erase(i);
}
void erase(Vertex_circulator i)
{ d_container.erase(i.mod_iterator()); }
Vertex_circulator erase(Vertex_circulator i)
{
return Vertex_circulator(&d_container,
d_container.erase(i.mod_iterator()));
}
/// Erases the vertices in the range `[first, last)`.
void erase(Vertex_iterator first, Vertex_iterator last)
Vertex_iterator erase(Vertex_iterator first, Vertex_iterator last)
{
d_container.erase(first, last);
return d_container.erase(first, last);
}
/// Erases the vertices in the range `[first, last)`.