diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index 6fecb592a12..9e46877c7d5 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -890,7 +890,7 @@ private: break; } default:{ - CGAL_assertion(false); // !!! Never reached + CGAL_unreachable(); } } } diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h index 6d77e38f904..c2fa9ca8d71 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h @@ -212,7 +212,7 @@ public: exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2) ); break; default: - CGAL_assertion(false); + CGAL_unreachable(); } } @@ -229,7 +229,7 @@ public: approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2) ); break; default: - CGAL_assertion(false); + CGAL_unreachable()); } } diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h index 219c307815a..6023edd8e8b 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h @@ -224,7 +224,7 @@ public: approx_ = Approx_squared_radius()( to_approx(*data().p0),to_approx(*data().p1),to_approx(*data().p2),to_approx(*data().p3) ); break; default: - CGAL_assertion(false); + CGAL_unreachable(); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index 9904b170542..674db5583fe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -605,10 +605,9 @@ public: case CGAL_TD_VERTEX: return TD_VERTEX; default: - CGAL_assertion(false); - return TD_TRAPEZOID; - } + CGAL_unreachable(); } + } /*! Access trapezoid type flag. */ CGAL_TD_INLINE unsigned char type_flag() const diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 4256fd0dc17..f1e83b22b0b 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -91,10 +91,8 @@ public: DirectionOutputIterator operator()(const unsigned int cone_number, const Direction_2& initial_direction, DirectionOutputIterator result) { - if (cone_number<2) { - std::cout << "The number of cones must be larger than 1!" << std::endl; - CGAL_assertion(false); - } + + CGAL_assertion_msg(cone_number>1, "The number of cones must be larger than 1"); *result++ = initial_direction; diff --git a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h index 8f2b599f311..71b4f338dd4 100644 --- a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h @@ -93,10 +93,7 @@ public: ): cone_number(k), cones_choice(cones_selected), rays(std::vector(k)) { - if (k<2) { - std::cout << "The number of cones must be larger than 1!" << std::endl; - CGAL_assertion(false); - } + CGAL_assertion_msg(k>1, "The number of cones must be larger than 1"); /* Initialize a functor, specialization will happen here depending on the kernel type to compute the cone boundaries either exactly or inexactly */ diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h b/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h index e86d696bc0b..a8779480c0b 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h @@ -420,7 +420,7 @@ public: } void set_crossed(const Edge_descriptor& edge, std::size_t sp_idx) { - CGAL_assertion(false); + CGAL_assertion(false); // AF: I am surprised that after the assert we do something m_graph[edge].crossed.insert(sp_idx); } }; diff --git a/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp b/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp index 0edc6f05f18..0231529e692 100644 --- a/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp @@ -728,7 +728,7 @@ end() endPolygonMesh(transform_matrix); break; default: - CGAL_assertion(false); + CGAL_unreachable(); } dockWidget->hide(); diff --git a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h index c85b1476fb9..5303221a9f3 100644 --- a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h +++ b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages_with_index.h @@ -191,12 +191,8 @@ namespace CGAL { // Allocate a dart for null_dart_descriptor assert(mdarts.empty()); // the compact container is empty Dart_index local_null_dart_descriptor = mdarts.emplace(); - if(local_null_dart_descriptor!=0) - { - std::cerr<<"[ERROR] fatal in CMap_linear_cell_complex_storage_with_index::init_storage" - <source(), s->target()); else { - CGAL_assertion(false); + CGAL_assertion(false); AF: So are we not completely sure? return std::nullopt; } }; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index 2e93f2f8335..c39c85f3111 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -844,7 +844,7 @@ void set_index(typename C3t3::Vertex_handle v, const C3t3& c3t3) case -1://far points from concurrent Mesh_3 break; default: - CGAL_assertion(false); + CGAL_unreachable(); } } diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index 714e9295b61..6988b39ce5b 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -489,7 +489,7 @@ public: pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_assertion(false); + CGAL_unreachable(); return std::make_pair(fit,eit); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 433ea5cb5af..a7c1b543062 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -1488,7 +1488,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int li) case VERTEX: return loc->vertex(li); } - CGAL_assertion(false); // locate step failed + CGAL_unreachable(); // AF: The comment "locate step failed" gives the idea that it may fail, but all cases are covered return Vertex_handle(); }