diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index 7623916b0a5..abc2805a2fb 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -423,7 +424,7 @@ 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); } + { return *(cpp11::next(d_container.begin(), i)); } /// Returns a (const) reference to the `i`-th vertex. @@ -432,7 +433,7 @@ class Polygon_2 { /// Returns the `i`-th edge. Segment_2 edge(std::size_t i) const - { return *(edges_begin() + i); } + { return *(cpp11::next(edges_begin(), i)); } /// @}