diff --git a/STL_Extension/include/CGAL/Spatial_lock_grid_3.h b/STL_Extension/include/CGAL/Spatial_lock_grid_3.h index 7c6ab2d39b8..9ed4420bbbb 100644 --- a/STL_Extension/include/CGAL/Spatial_lock_grid_3.h +++ b/STL_Extension/include/CGAL/Spatial_lock_grid_3.h @@ -209,7 +209,7 @@ public: int index_x = static_cast( (CGAL::to_double(point.x()) - m_bbox.xmin()) * m_resolution_x); //index_x = std::max( 0, std::min(index_x, m_num_grid_cells_per_axis - 1) ); index_x = - (index_x < 0 ? + (index_x < 0 ? /// @TODO: use std::clamp 0 : (index_x >= m_num_grid_cells_per_axis ? m_num_grid_cells_per_axis - 1 diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index ea9525febbf..2c600548c69 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -2613,8 +2613,17 @@ remove(Vertex_handle v, bool *could_lock_zone) if(!vertex_validity_check(v, tds())) return true; // vertex is already gone from the TDS, nothing to do - Vertex_handle hint = v->cell()->vertex(0) == v ? v->cell()->vertex(1) : v->cell()->vertex(0); - +#ifndef CGAL_LINKED_WITH_TBB + using Vertex_handle_and_point = Vertex_handle; +#endif // not CGAL_LINKED_WITH_TBB + Vertex_handle_and_point hint_and_point{v->cell()->vertex(0) == v ? v->cell()->vertex(1) : v->cell()->vertex(0)}; +#ifdef CGAL_LINKED_WITH_TBB + const Vertex_handle& hint = hint_and_point.vh; + const Weighted_point& hint_point_mem = hint_and_point.wpt; +#else // not CGAL_LINKED_WITH_TBB + const Vertex_handle& hint = hint_and_point; + const Weighted_point& hint_point_mem = hint_and_point->point(); +#endif // not CGAL_LINKED_WITH_TBB Self tmp; Vertex_remover remover(tmp); removed = Tr_Base::remove(v, remover, could_lock_zone); @@ -2641,13 +2650,12 @@ remove(Vertex_handle v, bool *could_lock_zone) // the hint. if(!vertex_validity_check(hint, tds())) { - hint = finite_vertices_begin(); + hint_and_point = finite_vertices_begin(); continue; } // We need to make sure that while are locking the position P1 := hint->point(), 'hint' // does not get its position changed to P2 != P1. - const Weighted_point hint_point_mem = hint->point(); if(this->try_lock_point(hint_point_mem) && this->try_lock_point(wp)) { @@ -2657,7 +2665,7 @@ remove(Vertex_handle v, bool *could_lock_zone) if(!vertex_validity_check(hint, tds()) || hint->point() != hint_point_mem) { - hint = finite_vertices_begin(); + hint_and_point = finite_vertices_begin(); this->unlock_all_elements(); continue; } @@ -2668,7 +2676,7 @@ remove(Vertex_handle v, bool *could_lock_zone) { success = true; if(hv != Vertex_handle()) - hint = hv; + hint_and_point = hv; } }