diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index a84d9d3f254..b7bb10f80c8 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 c3be1d69954..409087417e5 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 @@ public: 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 adb87606563..36ae18f1d7f 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..fb2b69ce073 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..2603c6af784 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 @@ public: 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 @@ 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/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h b/BGL/include/CGAL/boost/graph/internal/initialized_index_maps_helpers.h index eddefcec7fb..7a3320fc97f 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 3bd915f0b5d..b16b2c179d1 100644 --- a/Classification/include/CGAL/Classification/Image.h +++ b/Classification/include/CGAL/Classification/Image.h @@ -46,7 +46,7 @@ public: // 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 2a926f2f6c7..db982ef76a3 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 CGAL_assertion(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 cd71ce6d04d..ac08ca54921 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 @@ 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/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h index 640bb25a299..48a904555d3 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/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h index 7678de819f5..b4c0daf7a5e 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 fa0ba377b4d..23d72aa4034 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 850f3e364b0..9f020e5cb27 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 acc6d4a41df..2ab57031e30 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 28d7920bd2a..064496e3929 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 a5b5dd1fc76..5f127755af2 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 ea0462dadd6..952211f0c41 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 f22d551e842..c2429b68fc9 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 ada4bc5207e..c429172b3c5 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 23fc5d897f4..fcc929708ea 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 0ab18e3e0c8..cd2fcfe1f62 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 caa0b566ba8..7f4eb260413 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h @@ -418,8 +418,7 @@ private: return true; } - CGAL_assertion(false); - return false; + CGAL_unreachable(); } IVertex non_collinear_vertex(const PFace& pface, const IEdge& iedge) const { 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/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Smoothing_plugin.cpp index 91673050de3..f2f4ec90570 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 205a425c902..3fb7e1c2ab0 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 @@ -190,13 +190,9 @@ namespace CGAL { { // Allocate a dart for null_dart_descriptor CGAL_assertion(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 74dbb09b2ca..9bb07ec9d5d 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 @@ public: 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 4bb670cbaa9..19ac20f0702 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 d31ac841756..2577d9db1e4 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 cdcbe384173..a9e18429f2e 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 01215b09963..332150fc21a 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -1137,11 +1137,7 @@ private: } 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 652d0b09952..c34dc8aadae 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 6dc9ea082ff..8f4540f1bd3 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 @@ -1961,7 +1961,7 @@ private: 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 7f126709867..961bba0cf7a 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 @@ public: 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 c78bc09543c..6307e1bf2f5 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 @@ private: // 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 @@ private: otherpnt = seg.source(); } else { // unreachable - CGAL_assertion( false ); + CGAL_assertion(false); } lhor = compute_horizontal_side_line( @@ -1138,7 +1138,7 @@ private: 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 cf35f9476c8..4675a46348a 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 @@ private: 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 @@ private: 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 8ea07173025..bad4f8fc5ab 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 @@ private: 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 @@ private: 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 ce7fa34a79c..38ec084673b 100644 --- a/Straight_skeleton_2/include/CGAL/Trisegment_2.h +++ b/Straight_skeleton_2/include/CGAL/Trisegment_2.h @@ -148,7 +148,7 @@ public: 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 @@ public: 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 e3682606748..887eabd7f3e 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 @@ public: 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 @@ public: 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 17cfb22d3a7..f69fe5416e8 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 @@ public: V1_max = zmax; break; default: - CGAL_assertion(false); + CGAL_unreachable(); } switch (second_longest_axis) { @@ -225,7 +225,7 @@ public: 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 48610f5e523..3705683ce0c 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 200ffb82937..52e386b0000 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 e254fed4b55..7db0cf910fa 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 cf73ab88891..e43f19d8e6b 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -880,13 +880,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 2c3cfe46cd4..c47dc3ea59d 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 8e9aa157817..0af6138c5dc 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -496,8 +496,7 @@ public: 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 bb6230af7df..f2ed195bdaa 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -417,8 +417,7 @@ public: 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 94e5d5fb67a..4aa90d94b09 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -640,8 +640,7 @@ public: } 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 95e331ef2b7..c2a69a34b70 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -1497,8 +1497,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 215a48dace2..c283dddd18c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h @@ -251,8 +251,7 @@ private: 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 d52f68c5646..1ea95608460 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 @@ private: default: CGAL_unreachable(); } - //should not be reached CGAL_unreachable(); - return false; } bool cell_has_edge(const Cell_handle ch, const Edge& e) const @@ -1057,7 +1055,7 @@ private: } 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); } @@ -1074,7 +1072,7 @@ private: } 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 545e54ac112..6b26605356c 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 a2bf487b43f..c4e4217dacc 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 @@ private: } CGAL_unreachable(); - return false; } };