diff --git a/BGL/examples/BGL_arrangement_2/primal.cpp b/BGL/examples/BGL_arrangement_2/primal.cpp index 831e7ef1b75..b93a3284adb 100644 --- a/BGL/examples/BGL_arrangement_2/primal.cpp +++ b/BGL/examples/BGL_arrangement_2/primal.cpp @@ -46,60 +46,6 @@ double get(Edge_length_func edge_length, Arrangement_2::Halfedge_handle e) { return edge_length(e); } - -/* The following is a workaround for a bug in the BGL up to and including version - * 103400. - * - * Unfortunately some of the calls to the get() function below from the BGL - * code are qualified with the boost namespace, while others are not. For The - * qualified calls the compiler naturally looks for the definition of the - * function in boost namespace. For the other calls it searches the CGAL - * namespace according to ADL (Koenig Lookup), as the type of the 1st - * parameter is in CGAL namespace. - * - * One way to get around it is to provide 2 similar functions that do the - * same thing. One in CGAL namespace provided in CGAL/Arr_vertex_map.h, and - * the other in boost namespace below. The signature of the latter is slightly - * changed to avoid redefinition. The type of its 1st parameter is defined in - * boost namespace, and is a simple derivation of the 1st parameter of the - * CGAL::get() function. - */ - -namespace boost { - -template -class Arr_vertex_index_map_boost : - public CGAL::Arr_vertex_index_map -{ - public: - typedef CGAL::Arr_vertex_index_map Base; - /*! Default constructor. */ - Arr_vertex_index_map_boost() : Base() {} - - /*! Constructor from CGAL index map. */ - Arr_vertex_index_map_boost(Base & other) : - CGAL::Arr_vertex_index_map(other) - {} -}; - -/*! - * Get the index property-map function. Provided so that boost is able to - * access the Arr_vertex_index_map above. - * \param index_map The index map. - * \param v A vertex handle. - * \return The vertex index. - */ -template -unsigned int -get(const boost::Arr_vertex_index_map_boost & index_map, - typename Arrangement::Vertex_handle v) -{ - const CGAL::Arr_vertex_index_map & index_map_tmp = - static_cast &>(index_map); - return CGAL::get(index_map_tmp, v); -} - -} int main() { @@ -119,13 +65,12 @@ int main() insert (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3))); // Create a mapping of the arrangement vertices to indices. - CGAL::Arr_vertex_index_map index_map_tmp(arr); - boost::Arr_vertex_index_map_boost index_map(index_map_tmp); + CGAL::Arr_vertex_index_map index_map(arr); // Perform Dijkstra's algorithm from the vertex v0. Edge_length_func edge_length; - boost::vector_property_map > dist_map(static_cast(arr.number_of_vertices()), index_map); + boost::vector_property_map > dist_map(static_cast(arr.number_of_vertices()), index_map); boost::dijkstra_shortest_paths(arr, v0, boost::vertex_index_map(index_map). weight_map(edge_length).