diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index a84d9d3f2542..b7bb10f80c80 100644 --- a/AABB_tree/demo/AABB_tree/Scene.cpp +++ b/AABB_tree/demo/AABB_tree/Scene.cpp @@ -1252,9 +1252,7 @@ void Scene::cutting_plane(bool override) return; } - // Should not be here - std::cerr << "Unknown cut_plane type" << std::endl; - CGAL_assertion(false); + CGAL_unreachable(); } } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index c3be1d699544..409087417e56 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -1665,13 +1665,8 @@ class Algebraic_curve_kernel_2 : public AlgebraicKernel_d_1{ const Polynomial_2& f = ca1.polynomial_2(); const Polynomial_2& g = ca2.polynomial_2(); - if(f == g) { - // both curves are equal, but have different representations! - // std::cout <<"f: " << f <gcd_cache_2(); typedef typename Curve_analysis_2::size_type size_type; Polynomial_2 gcd = gcd_cache(std::make_pair(f,g)); 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 6fecb592a121..9e46877c7d5f 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 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > { 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 6d77e38f9045..fb2b69ce0737 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 @@ class Lazy_alpha_nt_2 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 @@ class Lazy_alpha_nt_2 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 219c307815a1..2603c6af7849 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 @@ -205,7 +205,7 @@ class Lazy_alpha_nt_3{ exact_ = Exact_squared_radius()( to_exact(*data().p0),to_exact(*data().p1),to_exact(*data().p2),to_exact(*data().p3) ); break; default: - CGAL_assertion(false); + CGAL_unreachable(); } } @@ -224,7 +224,7 @@ class Lazy_alpha_nt_3{ 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 9904b1705420..674db5583fe0 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 @@ class Td_X_trapezoid : public Handle 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/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h index eddefcec7fb2..7a3320fc97fd 100644 --- a/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h @@ -80,13 +80,6 @@ bool is_index_map_valid(const CGAL::internal_np::face_index_t, FaceIndexProperty return is_index_map_valid(face_index_map, num_faces(g), faces(g)); } -template -void initialize_index_map(const PropertyTag, IndexPropertyMap, const Graph&) -{ - // Unknown parameter; should never be here. - CGAL_assertion(false); -} - template ::value> @@ -120,12 +113,6 @@ struct Index_map_initializer put(face_index_map, fd, i++); } - template - void operator()(const PropertyTag, IndexPropertyMap, const Graph&) - { - // Unknown parameter; should never be here. - CGAL_assertion(false); - } }; template diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h index 084e9572764a..afdee2d6e2a4 100644 --- a/Classification/include/CGAL/Classification/Image.h +++ b/Classification/include/CGAL/Classification/Image.h @@ -46,7 +46,7 @@ class Image // https://github.com/boostorg/core/issues/148 Image(const Image&) { - CGAL_assertion(false); + CGAL_unreachable(); } Image () : m_width(0), m_height(0), m_depth(0) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h index d69147d18206..2966bf0b9d53 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h @@ -169,13 +169,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 Combinatorial_map_storage_with_index::init_storage" - <1, "The number of cones must be larger than 1"); *result++ = initial_direction; diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h index d4b47ed33c22..d36a7068f141 100644 --- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h @@ -99,10 +99,7 @@ class Construct_theta_graph_2 { ): 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/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h index 8f2b599f311a..71b4f338dd4b 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 @@ class Construct_yao_graph_2 { ): 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/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h index 7678de819f53..b4c0daf7a5e9 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h @@ -876,7 +876,6 @@ Aff_transformation_repH2::homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT(0); } template < class R > @@ -920,7 +919,6 @@ Translation_repH2::homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT(0); } template < class R > @@ -955,7 +953,6 @@ Translation_repH2::cartesian(int i, int j) const } } CGAL_unreachable(); - return FT(0); } template < class R > @@ -991,7 +988,6 @@ homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT(0); } template < class R > @@ -1027,7 +1023,6 @@ cartesian(int i, int j) const } } CGAL_unreachable(); - return FT(0); } template < class R > @@ -1063,7 +1058,6 @@ homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT(0); } template @@ -1099,7 +1093,6 @@ cartesian(int i, int j) const } } CGAL_unreachable(); - return FT(0); } template < class R > @@ -1136,7 +1129,6 @@ homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT(0); } template @@ -1173,7 +1165,6 @@ cartesian(int i, int j) const } } CGAL_unreachable(); - return FT(0); } } //namespace CGAL diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h index fa0ba377b4d3..23d72aa4034a 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -737,7 +737,6 @@ homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT0; } template < class R > @@ -895,7 +894,6 @@ Translation_repH3::homogeneous(int i, int j) const } } CGAL_unreachable(); - return RT0; } template < class R > diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h index 850f3e364b07..9f020e5cb27b 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -185,8 +186,7 @@ Ray_2_Ray_2_pair::intersection_type() const } } default: - CGAL_kernel_assertion(false); // should not be reached: - return _result; + CGAL_unreachable(); } } diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h index acc6d4a41dfa..2ab57031e30b 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -203,8 +204,7 @@ Ray_2_Segment_2_pair::intersection_type() const } } default: - CGAL_kernel_assertion(false); // should not be reached: - return _result; + CGAL_unreachable(); } } diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h index 28d7920bd2a9..064496e39296 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -141,8 +142,7 @@ seg_seg_do_intersect_crossing( default: CGAL_unreachable(); } - CGAL_kernel_assertion(false); - return S2S2_inter_info(false); + CGAL_unreachable(); } // used internally by Arr_segment_traits_2template @@ -202,8 +202,7 @@ seg_seg_do_intersect_contained( default: CGAL_unreachable(); } - CGAL_kernel_assertion(false); - return S2S2_inter_info(false); + CGAL_unreachable(); } // used internally by Arr_segment_traits_2 @@ -319,8 +318,7 @@ do_intersect_with_info(const typename K::Segment_2 &seg1, CGAL_unreachable(); } - CGAL_kernel_assertion(false); - return S2S2_inter_info(false); + CGAL_unreachable(); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h index a5b5dd1fc76b..5f127755af2c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h @@ -15,6 +15,7 @@ #include #include +#include namespace CGAL { namespace Intersections { @@ -57,13 +58,11 @@ do_intersect(const typename K::Triangle_3& t, case POSITIVE: return (orientation(p,q,c,a) != NEGATIVE); case NEGATIVE: return (orientation(p,q,c,a) != POSITIVE); case COPLANAR: return true; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h index ea0462dadd6e..952211f0c412 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h @@ -15,6 +15,7 @@ #include #include +#include namespace CGAL { namespace Intersections { @@ -43,8 +44,7 @@ do_intersect(const typename K::Triangle_3& t, case ON_ORIENTED_BOUNDARY: return true; default:// should not happen. - CGAL_kernel_assertion(false); - return false; + CGAL_unreachable(); } } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h index f22d551e8421..c2429b68fc98 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h @@ -15,6 +15,7 @@ #include #include +#include namespace CGAL { namespace Intersections { @@ -59,12 +60,10 @@ do_intersect(const typename K::Triangle_3& t, return (coplanar_orientation(c,a,p) != POSITIVE); case COLLINEAR: return true; default: // should not happen. - CGAL_kernel_assertion(false); - return false; + CGAL_unreachable(); } default: // should not happen. - CGAL_kernel_assertion(false); - return false; + CGAL_unreachable(); } } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h index ada4bc5207eb..c429172b3c56 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h @@ -15,6 +15,7 @@ #include #include +#include namespace CGAL { namespace Intersections { @@ -139,9 +140,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t, // a is isolated on the positive side return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE); - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } case NEGATIVE: @@ -165,9 +165,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t, // a is isolated on the negative side return visitor.result(coplanar_orientation(*b,*a,p) != POSITIVE); - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } case COLLINEAR: @@ -190,14 +189,12 @@ do_intersect_coplanar(const typename K::Triangle_3& t, return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE); // case pqc == COLLINEAR is imposiible - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } } @@ -262,9 +259,8 @@ do_intersect(const typename K::Triangle_3& t, return visitor.result(true); } // case COPLANAR: should not happen - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } case NEGATIVE: @@ -292,9 +288,8 @@ do_intersect(const typename K::Triangle_3& t, // case COPLANAR: should not happen - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } case COPLANAR: // p belongs to the triangle's supporting plane @@ -316,14 +311,12 @@ do_intersect(const typename K::Triangle_3& t, // case COPLANAR: should not happen - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } - default: // should not happen. - CGAL_kernel_assertion(false); - return visitor.result(false); + default: + CGAL_unreachable(); } } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h index 23fc5d897f43..fcc929708eab 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h @@ -15,7 +15,7 @@ #include #include - +#include namespace CGAL { namespace Intersections { namespace internal { @@ -79,9 +79,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A, // a is isolated on the positive side return coplanar_orientation(*a,*b,q) != NEGATIVE && coplanar_orientation(*c,*a,p) != NEGATIVE; - default:// should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } case NEGATIVE: switch ( pqb ) { @@ -109,9 +108,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A, return coplanar_orientation(*a,*b,p) != NEGATIVE && coplanar_orientation(*c,*a,q) != NEGATIVE; - default:// should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } case COLLINEAR: switch ( pqb ) { @@ -139,14 +137,11 @@ bool do_intersect_coplanar(const typename K::Point_3& A, // case pqc == COLLINEAR is impossible since the triangle is // assumed to be non flat - default:// should not happen. - CGAL_kernel_assertion(false); - return false; - + default: + CGAL_unreachable(); } - default:// should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } } @@ -215,9 +210,8 @@ do_intersect(const typename K::Triangle_3& t, return orientation(p,q,a,b) != POSITIVE && orientation(p,q,b,c) != POSITIVE && orientation(p,q,c,a) != POSITIVE; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } case NEGATIVE: switch ( abcq ) { @@ -237,9 +231,8 @@ do_intersect(const typename K::Triangle_3& t, && orientation(q,p,b,c) != POSITIVE && orientation(q,p,c,a) != POSITIVE; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } case COPLANAR: // p belongs to the triangle's supporting plane switch ( abcq ) { @@ -259,13 +252,11 @@ do_intersect(const typename K::Triangle_3& t, // supporting plane return do_intersect_coplanar(t,s,k); - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h index 0ab18e3e0c8c..cd2fcfe1f62d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace CGAL { @@ -304,21 +305,18 @@ do_intersect(const typename K::Triangle_3& t1, case COPLANAR: return do_intersect_coplanar(t1,t2,k); - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } break; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } break; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } const Point_3* s_min2; @@ -429,21 +427,18 @@ do_intersect(const typename K::Triangle_3& t1, // since the triangles are assumed to be non-flat return do_intersect_coplanar(t1,t2,k); - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } break; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } break; - default: // should not happen. - CGAL_kernel_assertion(false); - return false; + default: + CGAL_unreachable(); } return (orientation(*s_min1,*t_min1,*s_min2,*t_min2) != POSITIVE) && diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h b/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h index 8b1c033e8b44..08cf676664ea 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h @@ -414,8 +414,7 @@ class Finalizer { return true; } - CGAL_assertion(false); - return false; + CGAL_unreachable(); } IVertex non_collinear_vertex(const PFace& pface, const IEdge& iedge) const { 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 e86d696bc0b8..99b19ceb13d2 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Intersection_graph.h @@ -419,10 +419,6 @@ class Intersection_graph { return m_graph[edge].crossed.count(sp_idx) == 1; } - void set_crossed(const Edge_descriptor& edge, std::size_t sp_idx) { - CGAL_assertion(false); - m_graph[edge].crossed.insert(sp_idx); - } }; template std::size_t Intersection_graph::Edge_property::edge_counter = 0; diff --git a/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp b/Lab/demo/Lab/Plugins/PCA/Affine_transform_plugin.cpp index 0edc6f05f184..0231529e6928 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/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp index 91673050de35..f2f4ec90570c 100644 --- a/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp @@ -379,11 +379,6 @@ public Q_SLOTS: selection_item->poly_item_changed(); selection_item->changed_with_poly_item(); } - else - { - std::cerr << "Something's gone wrong.\n"; - CGAL_assertion(false); - } QApplication::restoreOverrideCursor(); } 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 c85b1476fb9a..3fb7e1c2ab08 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 @@ -189,14 +189,10 @@ namespace CGAL { void init_storage() { // 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" - < diff --git a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h index 74dbb09b2ca5..9bb07ec9d5dd 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h @@ -100,9 +100,7 @@ class Lloyd_move break; default: // Should not happen - CGAL_assertion(false); - return CGAL::NULL_VECTOR; - break; + CGAL_unreachable(); } return CGAL::NULL_VECTOR; diff --git a/Mesh_3/include/CGAL/Mesh_3/Robust_intersection_traits_3.h b/Mesh_3/include/CGAL/Mesh_3/Robust_intersection_traits_3.h index 4bb670cbaa98..19ac20f0702b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Robust_intersection_traits_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Robust_intersection_traits_3.h @@ -387,9 +387,8 @@ ts_intersection(const typename K::Triangle_3 &t, // Mesh_3, because if the intersection is not a point, it is // ignored anyway. return result_type(); - default: // should not happen. - CGAL_kernel_assertion(false); - return result_type(); + default: + CGAL_unreachable(); } } } diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index ddb1ba1109f6..11189652b0f0 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -976,12 +976,7 @@ Mesh_domain_with_polyline_features_3:: point_corner_index(const Point_3& p) const { typename Corners::const_iterator p_index_it = corners_.find(p); - if ( p_index_it == corners_.end() ) - { - CGAL_assertion(false); - return Index(); - } - + CGAL_assertion( p_index_it != corners_.end()); return p_index_it->second; } diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h index ae450d781e8d..e24b50b51627 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h @@ -169,6 +169,7 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot, auto it = std::min_element(volumes.begin(), volumes.end()); typename std::iterator_traits::difference_type d = std::distance(volumes.begin(), it); + CGAL_assertion(d == 0 || d == 1 || d == 2); #ifdef CGAL_OPTIMAL_BOUNDING_BOX_DEBUG_PP std::cout << "volumes: " << volumes[0] << " " << volumes[1] << " " << volumes[2] << std::endl; @@ -212,10 +213,6 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot, rot = opt * rot; } - else - { - CGAL_assertion(false); - } } // This operation makes no sense if an exact number type is used, so skip it, if so diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index ae2544567d73..23bb0f269339 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -1128,11 +1128,7 @@ class Poisson_reconstruction_function } while(circ != done); - if(voronoi_points.size() < 3) - { - CGAL_assertion(false); - return 0.0; - } + CGAL_assertion(! (voronoi_points.size() < 3)); // sum up areas FT area = 0.0; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h index 652d0b09952c..c34dc8aadaed 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersect_triangle_and_segment_3.h @@ -126,9 +126,8 @@ intersection_type( // p sees the triangle in counterclockwise order return find_intersection(p,q,a,b,c,h_2,tm2,false,true); - default: // should not happen. - CGAL_assertion(false); - return result_type(EMPTY,GT::null_halfedge(),false,false); + default: + CGAL_unreachable(); } case NEGATIVE: switch ( abcq ) { @@ -143,9 +142,8 @@ intersection_type( // q belongs to the triangle's supporting plane // p sees the triangle in clockwise order return find_intersection(q,p,a,b,c,h_2,tm2,false,true); - default: // should not happen. - CGAL_assertion(false); - return result_type(EMPTY,GT::null_halfedge(),false,false); + default: + CGAL_unreachable(); } case COPLANAR: // p belongs to the triangle's supporting plane switch ( abcq ) { @@ -163,13 +161,11 @@ intersection_type( return result_type(COPLANAR_TRIANGLES,GT::null_halfedge(),true,true); return result_type(EMPTY,GT::null_halfedge(),true,true); - default: // should not happen. - CGAL_assertion(false); - return result_type(EMPTY,GT::null_halfedge(),false,false); + default: + CGAL_unreachable(); } - default: // should not happen. - CGAL_assertion(false); - return result_type(EMPTY,GT::null_halfedge(),false,false); + default: + CGAL_unreachable(); } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 4d5622c6f0d8..b2188894a679 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -1940,7 +1940,7 @@ namespace internal { else if(is_on_mesh(h)) nb_mesh++; else if(is_on_border(h)) nb_border++; else if(is_an_isolated_constraint(h)) nb_isolated++; - else CGAL_assertion(false); + else CGAL_unreachable(); } CGAL_USE(nb_border); CGAL_USE(nb_mesh); diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Basic_predicates_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Basic_predicates_C2.h index 7f1267098670..961bba0cf7ac 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Basic_predicates_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Basic_predicates_C2.h @@ -641,9 +641,7 @@ struct Basic_predicates_C2 CGAL_SDG_DEBUG(std::cout << "ON_BOUNDED_SIDE" << std::endl;); return ON_BOUNDED_SIDE; default: - CGAL_SDG_DEBUG(std::cout << "error: should never reach here";); - CGAL_assertion( false ); - return ON_BOUNDARY; + CGAL_unreachable(); } } diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h index c78bc09543c2..6307e1bf2f5e 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h @@ -780,7 +780,7 @@ class Vertex_conflict_C2 // philaris: execution should never reach here // philaris: code added to avoid warnings on some compilers - CGAL_assertion( false ); + CGAL_assertion(false); return ZERO; } // end of case where segment is neither horizontal nor vertical @@ -877,7 +877,7 @@ class Vertex_conflict_C2 otherpnt = seg.source(); } else { // unreachable - CGAL_assertion( false ); + CGAL_assertion(false); } lhor = compute_horizontal_side_line( @@ -1138,7 +1138,7 @@ class Vertex_conflict_C2 otherpnt = seg.source(); } else { // unreachable - CGAL_assertion( false ); + CGAL_assertion(false); } lhor = compute_horizontal_side_line( diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_ring_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_ring_C2.h index cf35f9476c87..4675a46348ac 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_ring_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_ring_C2.h @@ -592,8 +592,8 @@ class Voronoi_vertex_ring_C2 const unsigned int bq = bearing(lq); const unsigned int br = bearing(lr); const unsigned int bdiff = bearing_diff(bq, br); - CGAL_assertion( bdiff != 0 ); - CGAL_assertion( bdiff != 7 ); + CGAL_assertion( bdiff > 0 ); + CGAL_assertion( bdiff < 7 ); if (bdiff == 1) { compute_pss_corner_and_pt(p, q, r, lq, lr, bq, br); @@ -605,8 +605,6 @@ class Voronoi_vertex_ring_C2 compute_pss_side_p_known(p, q, r, lq, lr, bq, br); } else if (bdiff == 6) { compute_pss_lines_side(p, lq, lr, (br+1)%8); - } else { - CGAL_assertion( false ); } CGAL_assertion_code( is_v_computed = true ); CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO ); diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h index 8ea071730250..bad4f8fc5ab3 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h @@ -1106,8 +1106,7 @@ class Voronoi_vertex_sqrt_field_new_C2 const Bearing bq = bearing(lq); const Bearing br = bearing(lr); const Bearing bdiff = bearing_diff(bq, br); - CGAL_assertion( bdiff != 0 ); - CGAL_assertion( bdiff != 7 ); + CGAL_assertion( bdiff > 0 && bdiff < 7 ); if (bdiff == 1) { compute_pss_corner_and_pt(p, lq, lr, bq, br); @@ -1119,9 +1118,8 @@ class Voronoi_vertex_sqrt_field_new_C2 compute_pss_side_p_known(p, q, r, lq, lr, bq, br); } else if (bdiff == 6) { compute_pss_lines_side(p, lq, lr, (br+1)%8); - } else { - CGAL_assertion( false ); } + CGAL_assertion( oriented_side_of_line(lq, this->point()) != ZERO ); CGAL_assertion( oriented_side_of_line(lr, this->point()) != ZERO ); } diff --git a/Straight_skeleton_2/include/CGAL/Trisegment_2.h b/Straight_skeleton_2/include/CGAL/Trisegment_2.h index ce7fa34a79c0..38ec084673b5 100644 --- a/Straight_skeleton_2/include/CGAL/Trisegment_2.h +++ b/Straight_skeleton_2/include/CGAL/Trisegment_2.h @@ -148,7 +148,7 @@ class Trisegment_2 case TRISEGMENT_COLLINEARITY_02: return e(2); default: - CGAL_assertion(false); + CGAL_unreachable(); return e(0); // arbitrary, meaningless value because a const& is expected } } @@ -166,8 +166,7 @@ class Trisegment_2 case TRISEGMENT_COLLINEARITY_02: return w(2); default: - CGAL_assertion(false); - return w(0); // arbitrary, meaningless value because a const& is expected + CGAL_unreachable(); } } diff --git a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h index a536e13ddaed..f1129a6e79f0 100644 --- a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h +++ b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h @@ -556,6 +556,7 @@ class Surface_mesh_deformation erase_control_vertex(vd); // also erase from being control typename std::vector::iterator it = std::find(roi.begin(), roi.end(), vd); + CGAL_assertion_msg(it != roi.end(), "inconsistency between is_roi_map, and roi vector"); if(it != roi.end()) { is_roi_map[id(vd)] = false; @@ -564,8 +565,6 @@ class Surface_mesh_deformation need_preprocess_both(); return true; } - - CGAL_assertion(false); // inconsistency between is_roi_map, and roi vector! return false; } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index 17cfb22d3a78..f69fe5416e85 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -205,7 +205,7 @@ class Two_vertices_parameterizer_3 V1_max = zmax; break; default: - CGAL_assertion(false); + CGAL_unreachable(); } switch (second_longest_axis) { @@ -225,7 +225,7 @@ class Two_vertices_parameterizer_3 V2_max = zmax; break; default: - CGAL_assertion(false); + CGAL_unreachable(); } // Project onto longest bounding box axes, diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/orbifold_cone_helper.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/orbifold_cone_helper.h index 48610f5e5236..3705683ce0cf 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/orbifold_cone_helper.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/orbifold_cone_helper.h @@ -122,8 +122,7 @@ void find_start_cone(const ConeMap& cmap, return; } - std::cerr << "Error: did not find first cone" << std::endl; - CGAL_postcondition(false); + CGAL_postcondition_msg(false,"Error: did not find first cone"); } // Locate the cone tagged 'First_unique_cone' in the seam mesh. @@ -143,8 +142,7 @@ void find_start_cone(const ConeMap& cmap, return; } - std::cerr << "Error: did not find first cone" << std::endl; - CGAL_postcondition(false); + CGAL_postcondition_msg(false,"Error: did not find first cone"); } /// Check the validity of the input cones in the `Seam_mesh` mesh. diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Functors_for_face_graph_wrapper.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Functors_for_face_graph_wrapper.h index 200ffb829379..52e386b0000f 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Functors_for_face_graph_wrapper.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Functors_for_face_graph_wrapper.h @@ -35,17 +35,8 @@ namespace internal { //////////////////////////////////////////////////////////////////////////////// /// Get_beta template -struct Get_beta -{ - typedef typename boost::graph_traits::halfedge_descriptor Dart_const_descriptor; +struct Get_beta; - static Dart_const_descriptor value(const HEG& /*heg*/, Dart_const_descriptor /*dh*/) - { - std::cout<<"ERROR Get_beta"< struct Get_beta { diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index 7eb651ef4074..4aa6fdafec0a 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -1118,8 +1118,8 @@ insert_dim_up(Vertex_handle w, bool orient) } break; default: - CGAL_assertion(false); - break; } + CGAL_unreachable(); + } return v; } diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index fd9981c1426a..aca5c18f196a 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -871,13 +871,9 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, { const auto intersection = proj.value().first; using Segment = typename Tr::Geom_traits::Segment_3; - if (const Segment* s = std::get_if(&intersection)) - return CGAL::midpoint(s->source(), s->target()); - else - { - CGAL_assertion(false); - return std::nullopt; - } + const Segment* s = std::get_if(&intersection); + CGAL_assertion(s != nullptr); + return CGAL::midpoint(s->source(), s->target()); }; const auto n = vertices_normals.at(v).at(si); 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 2e93f2f8335a..c39c85f31111 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 714e9295b61f..6e8d9ba164cc 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -489,8 +489,7 @@ class Constrained_Delaunay_triangulation_2 pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_assertion(false); - return std::make_pair(fit,eit); + CGAL_unreachable(); } template diff --git a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h index 617e8c23a8a4..2b616a8ca5cd 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -418,8 +418,7 @@ class Delaunay_triangulation_2 pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_assertion(false); - return std::make_pair(fit,eit); + CGAL_unreachable(); } template diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index 54938928e5c4..b1971f8bbf50 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -640,8 +640,7 @@ class Regular_triangulation_2 } return make_triple(fit, eit, vit); } - CGAL_assertion(false); - return make_triple(fit, eit, vit); + CGAL_unreachable(); } template diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 433ea5cb5af3..dc0de4ed4745 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -1488,8 +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 - return Vertex_handle(); + CGAL_unreachable(); } diff --git a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h index 295132483846..fd788a3e61a1 100644 --- a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h @@ -251,8 +251,7 @@ class Triangulation_hierarchy_2 Vertex_handle nearest_vertex_dispatch(const Point&, Face_handle, Tag_true) const { - CGAL_assertion(false); - return Vertex_handle(); + CGAL_unreachable(); } void locate_in_all(const Point& p, diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 6f25e793fda1..6b2288f5d338 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -944,9 +944,7 @@ class Triangulation_segment_simplex_iterator_3 default: CGAL_unreachable(); } - //should not be reached CGAL_unreachable(); - return false; } bool cell_has_edge(const Cell_handle ch, const Edge& e) const @@ -1056,7 +1054,7 @@ class Triangulation_segment_simplex_iterator_3 } while (++circ != end); std::cerr << "There is no facet shared by e and v" << std::endl; - CGAL_unreachable(); + CGAL_assertion(false); return Facet(Cell_handle(), 0); } @@ -1073,7 +1071,7 @@ class Triangulation_segment_simplex_iterator_3 } while (++circ != end); std::cerr << "There is no cell shared by e and v" << std::endl; - CGAL_unreachable(); + CGAL_assertion(false); return Cell_handle(); } diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h index 545e54ac112e..6b26605356ca 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h @@ -780,7 +780,7 @@ march_locate_2D(Face_handle f, } } - CGAL_precondition(false); + CGAL_assertion(false); } } @@ -972,9 +972,7 @@ march_locate_2D(Face_handle f, } default: { - // impossible - CGAL_assertion(false); - return f; + CGAL_unreachable(); } } diff --git a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h index fd7bfd719a8e..bbd74ca53d87 100644 --- a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h +++ b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h @@ -238,7 +238,6 @@ class Rotational_sweep_visibility_2 { } CGAL_unreachable(); - return false; } };