diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h b/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h index ae1ecb7efab..8eb58e59a92 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h @@ -67,9 +67,10 @@ public: return *this; } - Face_handle face_handle() const + std::size_t hash() const { - return this->first; + std::hash fct; + return fct(this->first); } bool operator==(const Edge& other) const @@ -273,6 +274,12 @@ public: : first(fd), second(i) {} + std::size_t hash() const + { + std::hash fct; + return fct(first); + } + bool operator==(const T2_halfedge_descriptor& other) const { return (first == other.first) && (second == other.second); @@ -830,8 +837,16 @@ namespace std { std::size_t operator()(const CGAL::detail::Edge& e) { std::cerr << "Triangulation_2::Edge HashFct" << std::endl; - std::hash::Face_handle> fct; - return fct(e.face_handle()); + return e.hash(); + } + }; + + template < class Tr> + struct hash > { + std::size_t operator()(const CGAL::detail::T2_halfedge_descriptor& e) + { + std::cerr << "Triangulation_2::halfedge_descriptor HashFct" << std::endl; + return e.hash(); } }; } // namespace std diff --git a/Surface_mesh/examples/Surface_mesh/unordered_set.cpp b/Surface_mesh/examples/Surface_mesh/unordered_set.cpp index b8a3f3b3a63..106782b81bd 100644 --- a/Surface_mesh/examples/Surface_mesh/unordered_set.cpp +++ b/Surface_mesh/examples/Surface_mesh/unordered_set.cpp @@ -49,7 +49,7 @@ int main() std::cout << "\ngraph_traits::_descriptor"<< std::endl; Unordered::vertex_descriptor> U3; - // Unordered::halfedge_descriptor> U4; + Unordered::halfedge_descriptor> U4; Unordered::edge_descriptor> U5; Unordered::face_descriptor> U6; }