From 0e18e8ec8c6f2f0ca2aa2c783d221870ef568b29 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 18 Jun 2014 23:16:13 +0300 Subject: [PATCH] [algorithms][is_valid] attempt to fix MSVC compilation errors --- .../detail/is_valid/complement_graph.hpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp index 741d10771..7d67aa56d 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp @@ -31,11 +31,10 @@ template class graph_vertex { public: - struct nil_vertex {}; - - static const nil_vertex nil; - - typedef typename std::set >::iterator vertex_handle; + typedef typename std::set + < + graph_vertex + >::const_iterator vertex_handle; struct vertex_handle_less { @@ -46,7 +45,7 @@ public: }; typedef std::set neighbor_container; - typedef typename neighbor_container::iterator neighbor_iterator; + typedef typename neighbor_container::const_iterator neighbor_iterator; graph_vertex(int id, TurnPoint const& dummy = TurnPoint()) : m_is_ip(false) @@ -83,7 +82,7 @@ public: vertex_handle parent() const { return m_parent.first; } void parent(vertex_handle p) const { m_parent = std::make_pair(p, true); } - void parent(nil_vertex) const + void initialize_parent() const { m_parent = std::make_pair(vertex_handle(), false); } @@ -141,10 +140,9 @@ private: typedef std::set vertex_container; public: - typedef typename vertex_container::iterator vertex_handle; + typedef typename vertex_container::const_iterator vertex_handle; private: - // implement this with a stack rather than recursively bool has_cycles(vertex_handle start_vertex) const { std::stack stack; @@ -220,7 +218,7 @@ public: it != m_vertices.end(); ++it) { it->visited(false); - it->parent(Vertex::nil); + it->initialize_parent(); } for (vertex_handle it = m_vertices.begin();