Merge pull request #2296 from sloriot/Polygon_2-fix_RA_for_NRAC

Make random accessor working even if the base container is not random…
This commit is contained in:
Laurent Rineau 2017-07-28 18:45:30 +02:00
commit 583ed73fd5
1 changed files with 3 additions and 2 deletions

View File

@ -35,6 +35,7 @@
#include <list>
#include <iterator>
#include <CGAL/algorithm.h>
#include <CGAL/circulator.h>
#include <CGAL/enum.h>
@ -425,7 +426,7 @@ class Polygon_2 {
const Point_2& vertex(std::size_t i) const
{
CGAL_precondition( i < d_container.size() );
return *(d_container.begin() + i);
return *(cpp11::next(d_container.begin(), i));
}
@ -435,7 +436,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)); }
/// @}