mirror of https://github.com/CGAL/cgal
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:
commit
583ed73fd5
|
|
@ -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)); }
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue