mirror of https://github.com/CGAL/cgal
Merge pull request #2083 from sloriot/Polygon-add_precondition
add a precondition
This commit is contained in:
commit
4ea09f4d1f
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue