Merge pull request #2083 from sloriot/Polygon-add_precondition

add a precondition
This commit is contained in:
Laurent Rineau 2017-05-19 10:29:02 +02:00
commit 4ea09f4d1f
1 changed files with 4 additions and 1 deletions

View File

@ -423,7 +423,10 @@ class Polygon_2 {
/// Returns a (const) reference to the `i`-th vertex.
const Point_2& vertex(std::size_t i) const
{ return *(d_container.begin() + i); }
{
CGAL_precondition( i < d_container.size() );
return *(d_container.begin() + i);
}
/// Returns a (const) reference to the `i`-th vertex.