diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 8c01c687981..36ea66b4765 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -763,6 +763,25 @@ namespace CGAL { return std::copy(vertices.begin(), vertices.end(), res); } + // In parallel operations, we need to be able to check the health of the 'hint' vertex handle, + // which might be invalided by other threads. One way to do that is the 'is_vertex()' function + // of the TDS, but it runs in O(sqrt(n)) complexity. When we are using our TDS, we can use + // a lower level function from the compact container, which runs in constant time. + template + struct Vertex_validity_checker + { + bool operator()(const typename TDS_::Vertex_handle vh_, const TDS_& tds_) { return tds_.is_vertex(vh_); } + }; + + template + struct Vertex_validity_checker > + { + typedef CGAL::Triangulation_data_structure_3 TDS_; + + bool operator()(const typename TDS_::Vertex_handle vh_, const TDS_& tds_) { + return tds_.vertices().is_used(vh_); } + }; + void remove (Vertex_handle v); // Concurrency-safe // See Triangulation_3::remove for more information @@ -1291,25 +1310,6 @@ namespace CGAL { } }; - // In parallel operations, we need to be able to check the health of the 'hint' vertex handle, - // which might be invalided by other threads. One way to do that is the 'is_vertex()' function - // of the TDS, but it runs in O(sqrt(n)) complexity. When we are using our TDS, we can use - // a lower level function from the compact container, which runs in constant time. - template - struct Vertex_validity_checker - { - bool operator()(const typename TDS_::Vertex_handle vh_, const TDS_& tds_) { return tds_.is_vertex(vh_); } - }; - - template - struct Vertex_validity_checker > - { - typedef CGAL::Triangulation_data_structure_3 TDS_; - - bool operator()(const typename TDS_::Vertex_handle vh_, const TDS_& tds_) { - return tds_.vertices().is_used(vh_); } - }; - // Functor for parallel insert(begin, end) function template class Insert_point