diff --git a/CDT/include/Triangulation.hpp b/CDT/include/Triangulation.hpp index 3d78897..d71cbe4 100644 --- a/CDT/include/Triangulation.hpp +++ b/CDT/include/Triangulation.hpp @@ -1906,29 +1906,33 @@ class FixedCapacityQueue }; template -struct less_than_x +class less_than_x { + const std::vector >& m_vertices; + +public: less_than_x(const std::vector >& vertices) - : vertices(vertices) + : m_vertices(vertices) {} bool operator()(const VertInd a, const VertInd b) const { - return vertices[a].x < vertices[b].x; + return m_vertices[a].x < m_vertices[b].x; } - const std::vector >& vertices; }; template -struct less_than_y +class less_than_y { + const std::vector >& m_vertices; + +public: less_than_y(const std::vector >& vertices) - : vertices(vertices) + : m_vertices(vertices) {} bool operator()(const VertInd a, const VertInd b) const { - return vertices[a].y < vertices[b].y; + return m_vertices[a].y < m_vertices[b].y; } - const std::vector >& vertices; }; } // namespace detail