diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h index e738302d533..87ebbe012ab 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h @@ -201,7 +201,7 @@ template boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > AABB_tree::first_intersection(const Ray& query, const SkipFunctor& skip) const { - CGAL_static_assertion_msg((std::is_same::value), + static_assert(std::is_same::value, "Ray and Ray_3 must be the same type"); switch(size()) // copy-paste from AABB_tree::traversal diff --git a/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp b/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp index c7198fe98e0..35612dc8ded 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp @@ -26,16 +26,16 @@ int main() { using namespace CGAL::internal::AABB_tree; - CGAL_static_assertion_msg( + static_assert( (Is_ray_intersection_geomtraits::value), "CGAL::Epeck should be a RayIntersectionGeomTraits"); - CGAL_static_assertion_msg( + static_assert( (Is_ray_intersection_geomtraits< CGAL::Simple_cartesian >::value), "CGAL::Epeck should be a RayIntersectionGeomTraits"); - CGAL_static_assertion_msg( + static_assert( (!Is_ray_intersection_geomtraits::value), "Pure AABBGeomTraits shouldn't be a RayIntersectionGeomTraits"); - CGAL_static_assertion_msg( + static_assert( (!Is_ray_intersection_geomtraits::value), "The empty struct shouldn't be a RayIntersectionGeomTraits"); diff --git a/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp b/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp index 1bd5f4bd02a..4ecbef7420c 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp +++ b/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp @@ -9,8 +9,8 @@ int main(){ typedef FT::Numerator_type Numerator_type; typedef FT::Denominator_type Denominator_type; - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); Numerator_type numerator; Denominator_type denominator; diff --git a/Algebraic_foundations/examples/Algebraic_foundations/interoperable.cpp b/Algebraic_foundations/examples/Algebraic_foundations/interoperable.cpp index abf8265a837..e85c2e8d73b 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/interoperable.cpp +++ b/Algebraic_foundations/examples/Algebraic_foundations/interoperable.cpp @@ -9,7 +9,7 @@ binary_func(const A& a , const B& b){ typedef CGAL::Coercion_traits CT; // check for explicit interoperability - CGAL_static_assertion((CT::Are_explicit_interoperable::value)); + static_assert(CT::Are_explicit_interoperable::value); // CT::Cast is used to to convert both types into the coercion type typename CT::Cast cast; diff --git a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h index cdfca730976..e0d5eee6706 100644 --- a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h +++ b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h @@ -353,8 +353,7 @@ class Algebraic_structure_traits_base< Type_, typedef Coercion_traits< NT1, NT2 > CT; typedef typename CT::Type Coercion_type_NT1_NT2; CGAL_USE_TYPE(Coercion_type_NT1_NT2); - CGAL_static_assertion(( - ::std::is_same::value)); + static_assert(::std::is_same::value); typename Coercion_traits< NT1, NT2 >::Cast cast; operator()( cast(x), cast(y), q, r ); diff --git a/Algebraic_foundations/include/CGAL/Coercion_traits.h b/Algebraic_foundations/include/CGAL/Coercion_traits.h index 14acb431c7c..f6c9092dec6 100644 --- a/Algebraic_foundations/include/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Coercion_traits.h @@ -35,9 +35,9 @@ #define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, Result_type ) \ template < class CT_Type_1, class CT_Type_2 > \ Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \ - CGAL_static_assertion((::std::is_same< \ + static_assert(::std::is_same< \ typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT \ - >::value)); \ + >::value) ; \ \ typename Coercion_traits< CT_Type_1, CT_Type_2 >::Cast cast; \ return operator()( cast(x), cast(y) ); \ diff --git a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h index db6b3df845d..5453868a132 100644 --- a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h +++ b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h @@ -85,13 +85,13 @@ public: // determine extractable scalar factor Scalar operator () (const NT& a) { - CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value)); + static_assert(::std::is_same< NT,Scalar >::value); typedef typename Algebraic_structure_traits::Algebraic_category SAT; return scalar_factor(a, SAT()); } // determine extractable scalar factor Scalar operator () (const NT& a, const Scalar& d) { - CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value)); + static_assert(::std::is_same< NT,Scalar >::value); typedef typename Algebraic_structure_traits::Algebraic_category SAT; return scalar_factor(a,d,SAT()); } diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h index f598b1fe7fe..56c421eee1f 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h @@ -44,7 +44,7 @@ template void check_result_type(AdaptableFunctor, ResultType){ typedef typename AdaptableFunctor::result_type result_type; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); CGAL_USE_TYPE(result_type); } // check nothing for CGAL::Null_functor @@ -122,12 +122,11 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) { CGAL_SNAP_AST_FUNCTORS(AST); using CGAL::Null_functor; - CGAL_static_assertion( - (!::std::is_same< Integral_division, Null_functor >::value)); - CGAL_static_assertion((!::std::is_same< Divides, Null_functor >::value)); - CGAL_static_assertion((!::std::is_same< Is_zero, Null_functor >::value)); - CGAL_static_assertion((!::std::is_same< Is_one, Null_functor >::value)); - CGAL_static_assertion((!::std::is_same< Square, Null_functor >::value)); + static_assert(!::std::is_same< Integral_division, Null_functor >::value); + static_assert(!::std::is_same< Divides, Null_functor >::value); + static_assert(!::std::is_same< Is_zero, Null_functor >::value); + static_assert(!::std::is_same< Is_one, Null_functor >::value); + static_assert(!::std::is_same< Square, Null_functor >::value); // functor const Is_zero is_zero = Is_zero(); @@ -206,7 +205,7 @@ void test_algebraic_structure_intern( CGAL_SNAP_AST_FUNCTORS(AST); using CGAL::Null_functor; - CGAL_static_assertion((!::std::is_same< Gcd, Null_functor>::value)); + static_assert(!::std::is_same< Gcd, Null_functor>::value); const Gcd gcd = Gcd(); assert( gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) ); @@ -268,9 +267,9 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) { CGAL_SNAP_AST_FUNCTORS(AST); using CGAL::Null_functor; - CGAL_static_assertion((!::std::is_same< Div, Null_functor>::value)); - CGAL_static_assertion((!::std::is_same< Mod, Null_functor>::value)); - CGAL_static_assertion((!::std::is_same< Div_mod, Null_functor>::value)); + static_assert(!::std::is_same< Div, Null_functor>::value); + static_assert(!::std::is_same< Mod, Null_functor>::value); + static_assert(!::std::is_same< Div_mod, Null_functor>::value); const Div div=Div(); const Mod mod=Mod(); @@ -387,7 +386,7 @@ void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) { CGAL_SNAP_AST_FUNCTORS(AST); - CGAL_static_assertion((!::std::is_same< Sqrt, Null_functor>::value)); + static_assert(!::std::is_same< Sqrt, Null_functor>::value); const Sqrt sqrt =Sqrt(); AS a(4); @@ -613,11 +612,9 @@ class Test_is_square { CGAL_USE_TYPE(First_argument_type); CGAL_USE_TYPE(Second_argument_type); - CGAL_static_assertion( - ( ::std::is_same< AS , First_argument_type>::value)); - CGAL_static_assertion( - ( ::std::is_same< AS& , Second_argument_type>::value)); - //CGAL_static_assertion(( ::std::is_same< bool , Result_type>::value)); + static_assert(::std::is_same< AS , First_argument_type>::value); + static_assert(::std::is_same< AS& , Second_argument_type>::value); + //static_assert(::std::is_same< bool , Result_type>::value); bool b = Result_type(true); CGAL_USE(b); AS test_number = AS(3)*AS(3); @@ -649,8 +646,8 @@ public: typedef typename Sqrt::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::std::is_same< AS , Argument_type>::value)); - CGAL_static_assertion(( ::std::is_same< AS , Result_type>::value)); + static_assert(::std::is_same< AS , Argument_type>::value); + static_assert(::std::is_same< AS , Result_type>::value); typedef Algebraic_structure_traits AST; typedef typename AST::Is_exact Is_exact; assert( !Is_exact::value || AS (3) == sqrt( AS (9))); @@ -675,12 +672,9 @@ public: CGAL_USE_TYPE(First_argument_type); CGAL_USE_TYPE(Second_argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion( - ( ::std::is_same::value)); - CGAL_static_assertion( - ( ::std::is_same< AS , Second_argument_type>::value)); - CGAL_static_assertion( - ( ::std::is_same< AS , Result_type>::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same< AS , Second_argument_type>::value); + static_assert(::std::is_same< AS , Result_type>::value); AS epsilon(1); assert( test_equality_epsilon( AS (2), root( 4, AS (16) ), epsilon ) ); @@ -803,7 +797,7 @@ void test_algebraic_structure(){ typedef CGAL::Algebraic_structure_traits< AS > AST; CGAL_SNAP_AST_FUNCTORS(AST); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef typename AST::Boolean Boolean; assert(!Boolean()); @@ -816,14 +810,13 @@ void test_algebraic_structure(){ using CGAL::Integral_domain_without_division_tag; using CGAL::Null_functor; // Test for desired exactness - CGAL_static_assertion( - ( ::std::is_same< typename AST::Is_exact, Is_exact >::value)); + static_assert(::std::is_same< typename AST::Is_exact, Is_exact >::value); + static_assert(::std::is_convertible< Tag, + Integral_domain_without_division_tag >::value ); + static_assert(::std::is_same< Tag, Algebraic_category>::value); + static_assert(!::std::is_same< Simplify, Null_functor>::value); + static_assert(!::std::is_same< Unit_part, Null_functor>::value); - CGAL_static_assertion(( ::std::is_convertible< Tag, - Integral_domain_without_division_tag >::value )); - CGAL_static_assertion(( ::std::is_same< Tag, Algebraic_category>::value)); - CGAL_static_assertion((!::std::is_same< Simplify, Null_functor>::value)); - CGAL_static_assertion((!::std::is_same< Unit_part, Null_functor>::value)); const Simplify simplify=Simplify();; const Unit_part unit_part= Unit_part(); @@ -943,8 +936,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) { typedef CGAL::Algebraic_structure_traits AST; typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive; - CGAL_static_assertion( - !(::std::is_same::value)); + static_assert(!::std::is_same::value); CGAL_USE_TYPE(Is_numerical_sensitive); } diff --git a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h index 0caa6ced04e..cff190a023d 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h @@ -326,7 +326,7 @@ void test_implicit_interoperable_one_way() { typedef typename CT::Type C; typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable; - CGAL_static_assertion( + static_assert( (::std::is_same::value)); assert((::std::is_same::value)); @@ -346,9 +346,9 @@ void test_explicit_interoperable_one_way(){ typedef typename CT::Cast Cast; typedef typename Cast::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value); + static_assert(::std::is_same::value); typename CT::Cast cast; A a(3); diff --git a/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h index e1aa91eb29d..6d11b6f2c55 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_fraction_traits.h @@ -37,11 +37,11 @@ void test_fraction_traits(){ typedef typename FT::Compose Compose; CGAL_USE_TYPE(Is_fraction); - CGAL_static_assertion( (::std::is_same::value)); - CGAL_static_assertion( (::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); + static_assert(!::std::is_same::value); + static_assert(!::std::is_same::value); + static_assert(!::std::is_same::value); // Decompose diff --git a/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h index 5efda40bc2f..68e648e69c5 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_rational_traits.h @@ -29,7 +29,7 @@ void test_rational_traits(){ typedef Rational_traits Rational_traits; typedef typename Rational_traits::RT RT; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); assert( Rational_traits().numerator(x) == RT(7)); assert( Rational_traits().denominator(x) == RT(2)); diff --git a/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h b/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h index bb67e3f57a5..fbe5b66132b 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_real_embeddable.h @@ -48,9 +48,9 @@ namespace CGAL { void operator() (const ToDouble& to_double) { typedef typename ToDouble::argument_type Argument_type; typedef typename ToDouble::result_type Result_type; - CGAL_static_assertion(( ::std::is_same::value)); + static_assert( ::std::is_same::value); CGAL_USE_TYPE(Argument_type); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert( ::std::is_same::value); CGAL_USE_TYPE(Result_type); assert(42.0 == to_double(Type(42))); } @@ -71,9 +71,9 @@ namespace CGAL { typedef typename To_interval::argument_type Argument_type; typedef typename To_interval::result_type Result_type; typedef std::pair Interval_type; - CGAL_static_assertion(( ::std::is_same::value)); + static_assert( ::std::is_same::value); CGAL_USE_TYPE(Argument_type); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert( ::std::is_same::value); CGAL_USE_TYPE(Result_type); CGAL_USE_TYPE(Interval_type); // assert(NiX::in(42.0,to_Interval(Type(42)))); @@ -139,7 +139,7 @@ void test_real_embeddable() { CGAL_SNAP_RET_FUNCTORS(RET); typedef typename RET::Is_real_embeddable Is_real_embeddable; using CGAL::Tag_true; - CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_true>::value)); + static_assert(::std::is_same< Is_real_embeddable, Tag_true>::value); CGAL_USE_TYPE(Is_real_embeddable); typedef typename RET::Boolean Boolean; @@ -246,7 +246,7 @@ void test_not_real_embeddable() { typedef CGAL::Real_embeddable_traits RET; typedef typename RET::Is_real_embeddable Is_real_embeddable; using CGAL::Tag_false; - CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_false>::value)); + static_assert(::std::is_same< Is_real_embeddable, Tag_false>::value); CGAL_USE_TYPE(Is_real_embeddable); } @@ -254,13 +254,13 @@ void test_not_real_embeddable() { //template //void test_rounded_log2_abs(Type zero, CGAL::Null_functor, CeilLog2Abs) { // typedef CGAL::Null_functor Null_functor; -// CGAL_static_assertion(( ::std::is_same< CeilLog2Abs, Null_functor>::value)); +// static_assert(::std::is_same< CeilLog2Abs, Null_functor>::value); //} // //template //void test_rounded_log2_abs(Type zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) { // typedef CGAL::Null_functor Null_functor; -// CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value)); +// static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value); // // assert( fl_log(Type( 7)) == 2 ); // assert( cl_log(Type( 7)) == 3 ); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp index 87e5235cfe1..95c89235190 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits.cpp @@ -9,21 +9,21 @@ int main(){ typedef AET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef AET::Is_extended Is_extended; CGAL_USE_TYPE(Is_extended); - CGAL_static_assertion( + static_assert( (::std::is_same::value)); typedef AET::Normalization_factor Normalization_factor; { typedef Normalization_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef Normalization_factor::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); Normalization_factor nfac; assert(nfac(3)==1); } @@ -31,10 +31,10 @@ int main(){ { typedef DFAI::argument_type argument_type; CGAL_USE_TYPE(argument_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef DFAI::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); DFAI dfai; assert(dfai(3)==1); } @@ -45,21 +45,21 @@ int main(){ typedef AET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef AET::Is_extended Is_extended; CGAL_USE_TYPE(Is_extended); - CGAL_static_assertion( + static_assert( (::std::is_same::value)); typedef AET::Normalization_factor Normalization_factor; { typedef Normalization_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef Normalization_factor::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); Normalization_factor nfac; assert(nfac(EXT(3))==1); assert(nfac(EXT(3,0,5))==1); @@ -69,10 +69,10 @@ int main(){ { typedef DFAI::argument_type argument_type; CGAL_USE_TYPE(argument_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef DFAI::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); DFAI dfai; assert(dfai(EXT(3))==1); assert(dfai(EXT(3,0,5))==1); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp index bc1e4b85bb0..efd31636c51 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits.cpp @@ -7,7 +7,7 @@ { \ typedef AST::NAME NAME; \ CGAL_USE_TYPE(NAME); \ - CGAL_static_assertion( \ + static_assert( \ (::std::is_same::value)); \ } @@ -16,19 +16,19 @@ int main(){ typedef AST::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef AST::Algebraic_category Algebraic_category; CGAL_USE_TYPE(Algebraic_category); - CGAL_static_assertion( + static_assert( (::std::is_same::value)); typedef AST::Is_exact Is_exact; CGAL_USE_TYPE(Is_exact); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef AST::Is_numerical_sensitive Is_sensitive; CGAL_USE_TYPE(Is_sensitive); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); CGAL_IS_AST_NULL_FUNCTOR ( Simplify); CGAL_IS_AST_NULL_FUNCTOR ( Unit_part); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp index 7deecf693cc..a0ec9d741a4 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Coercion_traits.cpp @@ -6,22 +6,17 @@ int main(){ { typedef CGAL::Coercion_traits CT; CGAL_USE_TYPE(CT); - CGAL_static_assertion(( std::is_same::value)); - CGAL_static_assertion( - ( std::is_same::value)); - CGAL_static_assertion( - ( std::is_same::value)); + static_assert( std::is_same::value); + static_assert( std::is_same::value); + static_assert( std::is_same::value); assert( 5 == CT::Cast()(5)); } { typedef CGAL::Coercion_traits CT; CGAL_USE_TYPE(CT); -// CGAL_static_assertion(( std::is_same::value)); - CGAL_static_assertion( - ( std::is_same::value)); - CGAL_static_assertion( - ( std::is_same::value)); - CGAL_static_assertion( - ( std::is_same::value)); +// static_assert( std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); } } diff --git a/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp index f9288c9eefd..f215c848458 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits.cpp @@ -7,7 +7,7 @@ { \ typedef RET::NAME NAME; \ CGAL_USE_TYPE(NAME); \ - CGAL_static_assertion( \ + static_assert( \ (::std::is_same::value)); \ } @@ -16,11 +16,11 @@ int main(){ typedef RET::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef RET::Is_real_embeddable Is_real_embeddable; CGAL_USE_TYPE(Is_real_embeddable); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); CGAL_IS_RET_NULL_FUNCTOR(Abs); CGAL_IS_RET_NULL_FUNCTOR(Sgn); diff --git a/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp index b2b6ffd0bf3..1fe2fcf620d 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits.cpp @@ -7,33 +7,31 @@ int main(){ typedef CGAL::Scalar_factor_traits SFT; CGAL_USE_TYPE(SFT); - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); typedef SFT::Scalar_factor Scalar_factor; { typedef Scalar_factor::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef Scalar_factor::argument_type argument_type; CGAL_USE_TYPE(argument_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); } typedef SFT::Scalar_div Scalar_div; { typedef Scalar_div::result_type result_type; CGAL_USE_TYPE(result_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef Scalar_div::first_argument_type first_argument_type; CGAL_USE_TYPE(first_argument_type); - CGAL_static_assertion( - (::std::is_same::value)); + static_assert(::std::is_same::value); typedef Scalar_div::second_argument_type second_argument_type; CGAL_USE_TYPE(second_argument_type); - CGAL_static_assertion( - (::std::is_same::value)); + static_assert(::std::is_same::value); } int i; 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 002e108b0ec..e92e01e0669 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 @@ -481,18 +481,18 @@ public: Curve_analysis_2 _construct_defining_polynomial_from(Bound b) const { typedef CGAL::Fraction_traits FT; // We rely on the fact that the Bound is a fraction - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef typename FT::Numerator_type Numerator; typedef typename FT::Denominator_type Denominator; typedef CGAL::Coercion_traits Num_coercion; - CGAL_static_assertion((::std::is_same + static_assert(::std::is_same ::value)); + typename Num_coercion::Type>::value); typedef CGAL::Coercion_traits Denom_coercion; - CGAL_static_assertion((::std::is_same + static_assert(::std::is_same ::value)); + typename Denom_coercion::Type>::value); typename Num_coercion::Cast num_cast; typename Denom_coercion::Cast denom_cast; typename FT::Decompose decompose; @@ -2541,18 +2541,18 @@ public: Polynomial_1 operator() (const Polynomial_2& f, Bound b) const { typedef CGAL::Fraction_traits FT; // We rely on the fact that the Bound is a fraction - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef typename FT::Numerator_type Numerator; typedef typename FT::Denominator_type Denominator; typedef CGAL::Coercion_traits Num_coercion; - CGAL_static_assertion((::std::is_same + static_assert(::std::is_same ::value)); + typename Num_coercion::Type>::value); typedef CGAL::Coercion_traits Denom_coercion; - CGAL_static_assertion((::std::is_same + static_assert(::std::is_same ::value)); + typename Denom_coercion::Type>::value); typename Num_coercion::Cast num_cast; typename Denom_coercion::Cast denom_cast; typename FT::Decompose decompose; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h index 54fcec0b3f5..2b5a30867ce 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h @@ -71,7 +71,7 @@ class Algebraic_real_d_1 : public ::CGAL::Handle_with_policy< AlgebraicRealRep_d_1, HandlePolicy > { // currently Rational is the only supported Bound type. - CGAL_static_assertion( + static_assert( ( ::std::is_same ::Arithmetic_kernel::Rational>::value)); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h index 1609fdbaa6b..e9ff71e3e66 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h @@ -186,7 +186,7 @@ template::value_type >::value)); @@ -224,14 +224,14 @@ template void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) { // We can assume that both template arguments are polynomial types typedef CGAL::Fraction_traits FT; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typedef typename FT::Numerator_type Numerator; typedef typename FT::Denominator_type Denominator; typedef CGAL::Coercion_traits Num_coercion; - CGAL_static_assertion((::std::is_same + static_assert(::std::is_same ::value)); + typename Num_coercion::Type>::value); Numerator p_num; Denominator p_denom; typename FT::Decompose()(p,p_num,p_denom); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp index 2e06d3b6aec..d5917a016e5 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Real_embeddable_traits_extension.cpp @@ -47,8 +47,8 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Floor::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::std::is_same::value)); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); assert(Integer(42) == floor(NT(42))); assert(Integer(-42) == floor(NT(-42))); } @@ -59,8 +59,8 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Floor_log2_abs::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::std::is_same::value)); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); assert(long(0) == floor_log2_abs(NT(1))); assert(long(0) == floor_log2_abs(NT(-1))); @@ -86,8 +86,8 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Ceil::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::std::is_same::value)); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); assert(Integer(42) == ceil(NT(42))); assert(Integer(-42) == ceil(NT(-42))); } @@ -98,8 +98,8 @@ void test_real_embeddable_extension(const NT_&){ typedef typename Ceil_log2_abs::result_type Result_type; CGAL_USE_TYPE(Argument_type); CGAL_USE_TYPE(Result_type); - CGAL_static_assertion(( ::std::is_same::value)); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); assert(long(0) == ceil_log2_abs(NT(1))); assert(long(0) == ceil_log2_abs(NT(-1))); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h index 01a27244d74..f3332c1a4d2 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h @@ -62,20 +62,20 @@ void test_algebraic_curve_kernel_2() { typedef AlgebraicCurveKernel_2 AK_2; - /* CGAL_static_assertion( (::std::is_same< - Algebraic_real_1, typename AK::Algebraic_real_1 >::value) ); + /* static_assert(::std::is_same< + Algebraic_real_1, typename AK::Algebraic_real_1 >::value); - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< Isolator, - typename AK::Isolator >::value) ); + typename AK::Isolator >::value); - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< Coefficient, - typename AK::Coefficient >::value)); + typename AK::Coefficient >::value); - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< Polynomial_1, - typename AK::Polynomial_1 >::value));*/ + typename AK::Polynomial_1 >::value);*/ typedef typename AK_2::Polynomial_2 Poly_2; typedef typename AK_2::Curve_analysis_2 Curve_analysis_2; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h index 20ecd337223..abe5ebfd32d 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h @@ -109,8 +109,8 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ typedef typename Name::result_type RT_; \ CGAL_USE_TYPE(AT_); \ CGAL_USE_TYPE(RT_); \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ } #define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \ { \ @@ -120,9 +120,9 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ CGAL_USE_TYPE(AT1_); \ CGAL_USE_TYPE(AT2_); \ CGAL_USE_TYPE(RT_); \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ } // TODO: missing check for Construct_algebraic_real_1 diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h index ff04c8f8c9d..bebcd0118e7 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h @@ -93,8 +93,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { typedef typename Name::result_type RT_; \ CGAL_USE_TYPE(AT_); \ CGAL_USE_TYPE(RT_); \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ } #define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \ { \ @@ -104,22 +104,22 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { CGAL_USE_TYPE(AT1_); \ CGAL_USE_TYPE(AT2_); \ CGAL_USE_TYPE(RT_); \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ - {CGAL_static_assertion(( ::std::is_same::value));} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ + {static_assert(::std::is_same::value);} \ } - CGAL_static_assertion(( ::std::is_same + static_assert(::std::is_same - ::value)); + ::value); CGAL_CHECK_UFUNCTION(Is_square_free_2,Polynomial_2,bool); CGAL_CHECK_UFUNCTION(Make_square_free_2,Polynomial_2,Polynomial_2); // TODO: missing check for Square_free_factorize_2 CGAL_CHECK_BFUNCTION(Is_coprime_2,Polynomial_2,Polynomial_2,bool); - CGAL_static_assertion(( ::std::is_same - ::value)); + static_assert(::std::is_same + ::value); CGAL_CHECK_BFUNCTION(Number_of_solutions_2,Polynomial_2,Polynomial_2, size_type); CGAL_CHECK_UFUNCTION(Compute_x_2,Algebraic_real_2,Algebraic_real_1); @@ -128,8 +128,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { CGAL_CHECK_UFUNCTION(Compute_polynomial_y_2,Algebraic_real_2,Polynomial_1); CGAL_CHECK_BFUNCTION(Isolate_x_2,Algebraic_real_2,Polynomial_1,BInterval); CGAL_CHECK_BFUNCTION(Isolate_y_2,Algebraic_real_2,Polynomial_1,BInterval); - CGAL_static_assertion(( ::std::is_same - < BArray,typename Isolate_2::result_type>::value)); + static_assert(::std::is_same + < BArray,typename Isolate_2::result_type>::value); CGAL_CHECK_BFUNCTION(Sign_at_2,Polynomial_2,Algebraic_real_2,Sign); CGAL_CHECK_BFUNCTION(Is_zero_at_2,Polynomial_2,Algebraic_real_2,bool); CGAL_CHECK_BFUNCTION(Compare_x_2,Algebraic_real_2,Algebraic_real_2,Sign); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h index a393abe3653..fa5bd929abe 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_comparable.h @@ -39,8 +39,8 @@ namespace internal { void operator() (ToDouble to_double) { typedef typename ToDouble::argument_type Argument_type; typedef typename ToDouble::result_type Result_type; - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); assert(42.0 == to_double(NT(42))); } }; @@ -59,8 +59,8 @@ namespace internal { void operator() (ToInterval to_Interval) { typedef typename ToInterval::argument_type Argument_type; typedef typename ToInterval::result_type Result_type; - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same< typename Argument_type::Interval, Result_type>::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same< typename Argument_type::Interval, Result_type>::value); // TODO: NiX::in not available!? //assert(NiX::in(42.0,to_Interval(NT(42)))); @@ -99,7 +99,7 @@ void test_real_comparable() { typedef CGAL::Real_embeddable_traits Traits; typedef typename Traits::Is_real_embeddable Is_real_comparable; using ::CGAL::Tag_true; - CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_true>::value)); + static_assert(::std::is_same< Is_real_comparable, Tag_true>::value); typename Traits::Compare compare; typename Traits::Sign sign; typename Traits::Abs abs; @@ -168,20 +168,20 @@ void test_not_real_comparable() { typedef CGAL::Real_embeddable_traits Traits; typedef typename Traits::Is_real_embeddable Is_real_comparable; using ::CGAL::Tag_false; - CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_false>::value)); + static_assert(::std::is_same< Is_real_comparable, Tag_false>::value); } template void test_rounded_log2_abs(NT zero, ::CGAL::Null_functor, CeilLog2Abs) { typedef ::CGAL::Null_functor Nulltype; - CGAL_static_assertion((::std::is_same< CeilLog2Abs, Nulltype>::value)); + static_assert(::std::is_same< CeilLog2Abs, Nulltype>::value); } template void test_rounded_log2_abs(NT zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) { typedef ::CGAL::Null_functor Null_functor; - CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value)); + static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value); assert( fl_log(NT( 7)) == 2 ); assert( cl_log(NT( 7)) == 3 ); diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index 3c4cb4b7d30..43be2407022 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -61,7 +61,7 @@ public: // because the periodic triangulations' point() function returns a temporary // value while the lazy predicate evaluations that are used when the Exact tag // is set to true rely on a permanent and safe access to the points. - CGAL_static_assertion( + static_assert( (std::is_same::value) || (std::is_same::value)); @@ -76,8 +76,8 @@ public: typedef Type_of_alpha FT; // check that simplices are correctly instantiated - CGAL_static_assertion( (std::is_same::value) ); - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); + static_assert(std::is_same::value); typedef typename Dt::Point Point; diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_vertex_base_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_vertex_base_2.h index e96dfaa5fcb..919fec145ec 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_vertex_base_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_vertex_base_2.h @@ -19,6 +19,7 @@ #include #include #include +#include //------------------------------------------------------------------- namespace CGAL { 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 84263d358f6..728cb446934 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 @@ -148,8 +148,8 @@ class Lazy_alpha_nt_2 Approx_point to_approx(const Input_point& wp) const { // The traits class' Point_2 must be convertible using the Cartesian converter - CGAL_static_assertion((Is_traits_point_convertible_2< - Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value)); + static_assert(Is_traits_point_convertible_2< + Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value); To_approx converter; return converter(wp); @@ -158,8 +158,8 @@ class Lazy_alpha_nt_2 Exact_point to_exact(const Input_point& wp) const { // The traits class' Point_2 must be convertible using the Cartesian converter - CGAL_static_assertion((Is_traits_point_convertible_2< - Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value)); + static_assert(Is_traits_point_convertible_2< + Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value); To_exact converter; return converter(wp); diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index be6849a5886..a4a93f82515 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -97,7 +97,7 @@ public: // because the periodic triangulations' point() function returns a temporary // value while the lazy predicate evaluations that are used when the Exact tag // is set to true rely on a permanent and safe access to the points. - CGAL_static_assertion( + static_assert( (std::is_same::value) || (std::is_same::value)); @@ -108,8 +108,8 @@ public: typedef typename Gt::FT Coord_type; //checks whether tags are correctly set in Vertex and Cell classes - CGAL_static_assertion( (std::is_same::value) ); - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); + static_assert(std::is_same::value); typedef typename Dt::Point Point; 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 14ff435b3e0..d753b2457cb 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 @@ -139,8 +139,8 @@ class Lazy_alpha_nt_3{ Approx_point to_approx(const Input_point& wp) const { // The traits class' Point_3 must be convertible using the Cartesian converter - CGAL_static_assertion((Is_traits_point_convertible_3< - Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value)); + static_assert(Is_traits_point_convertible_3< + Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value); To_approx converter; return converter(wp); @@ -149,8 +149,8 @@ class Lazy_alpha_nt_3{ Exact_point to_exact(const Input_point& wp) const { // The traits class' Point_3 must be convertible using the Cartesian converter - CGAL_static_assertion((Is_traits_point_convertible_3< - Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value)); + static_assert(Is_traits_point_convertible_3< + Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value); To_exact converter; return converter(wp); diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index 20982e9beaa..648835842e3 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -193,7 +193,7 @@ public: { // Due to the Steiner point computation being a dichotomy, the algorithm is inherently inexact // and passing exact kernels is explicitly disabled to ensure no misunderstanding. - CGAL_static_assertion((std::is_floating_point::value)); + static_assert(std::is_floating_point::value); } public: diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h index 6d0f65142f6..c87f82ac75f 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h @@ -146,7 +146,7 @@ public: VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tmesh)); - CGAL_static_assertion((std::is_same::value_type, Point_3>::value)); + static_assert(std::is_same::value_type, Point_3>::value); Splitter_base::reserve(num_faces(tmesh)); diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h index 57f936306da..0a8f589fc2d 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h @@ -143,7 +143,7 @@ public: #endif PPM pm = choose_parameter(get_parameter(np, internal_np::point_map)); - CGAL_static_assertion((std::is_same::value_type, Point_3>::value)); + static_assert(std::is_same::value_type, Point_3>::value); Splitter_base::reserve(faces.size()); diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp b/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp index f8b373c9764..7c48e66a2c1 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp +++ b/Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel.cpp @@ -18,17 +18,17 @@ int main() { { typedef CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; CGAL_USE_TYPE(AK_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } { typedef CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; CGAL_USE_TYPE(AK_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } { typedef CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; CGAL_USE_TYPE(AK_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } return 0; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index e1582795054..8686132cc41 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -90,10 +90,10 @@ public: typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category; - CGAL_static_assertion((std::is_same< Left_side_category, Arr_oblivious_side_tag >::value)); - CGAL_static_assertion((std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value)); - CGAL_static_assertion((std::is_same< Top_side_category, Arr_oblivious_side_tag >::value)); - CGAL_static_assertion((std::is_same< Right_side_category, Arr_oblivious_side_tag >::value)); + static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value); + static_assert(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value); + static_assert(std::is_same< Top_side_category, Arr_oblivious_side_tag >::value); + static_assert(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value); //@} /*! \struct diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index 39a618a754d..af2ea182fa7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -38,7 +38,7 @@ namespace CGAL { inline void* _clean_pointer(const void* p) { - CGAL_static_assertion(sizeof(void*) == sizeof(size_t)); + static_assert(sizeof(void*) == sizeof(size_t)); const size_t mask = ~1; const size_t val = (reinterpret_cast(p) & mask); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index 8dc8cdf6fce..19a95a662f6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -172,14 +172,14 @@ overlay(const Arrangement_on_surface_2& arr1 typedef typename Agt2::Point_2 A_point; typedef typename Bgt2::Point_2 B_point; typedef typename Rgt2::Point_2 Res_point; - CGAL_static_assertion((std::is_convertible::value)); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); + static_assert(std::is_convertible::value); typedef typename Agt2::X_monotone_curve_2 A_xcv; typedef typename Bgt2::X_monotone_curve_2 B_xcv; typedef typename Rgt2::X_monotone_curve_2 Res_xcv; - CGAL_static_assertion((std::is_convertible::value)); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); + static_assert(std::is_convertible::value); typedef Arr_traits_basic_adaptor_2 Gt_adaptor_2; typedef Arr_overlay_traits_2 diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h index 7ebec8a5eb6..f0ff24f1291 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h @@ -62,9 +62,9 @@ public: typedef std::vector > Root_multiplicity_vector; - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); public: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h index ef568ab6cad..8b076506227 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h @@ -100,9 +100,9 @@ public: typedef Algebraic_point_2 Point_2; - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); public: const Rational_function& get_rational_function(const Polynomial_1& numerator, diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index 9b4ea137450..67202ce862f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -91,14 +91,14 @@ public: typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category; - CGAL_static_assertion((std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Left_side_category, Arr_identified_side_tag >::value)); - CGAL_static_assertion((std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Bottom_side_category, Arr_contracted_side_tag >::value)); - CGAL_static_assertion((std::is_same< Top_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Top_side_category, Arr_contracted_side_tag >::value)); - CGAL_static_assertion((std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Right_side_category, Arr_identified_side_tag >::value)); + static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Left_side_category, Arr_identified_side_tag >::value); + static_assert(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Bottom_side_category, Arr_contracted_side_tag >::value); + static_assert(std::is_same< Top_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Top_side_category, Arr_contracted_side_tag >::value); + static_assert(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Right_side_category, Arr_identified_side_tag >::value); //@} /*! \struct diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 355dd76641e..09cc7c94710 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -87,14 +87,14 @@ public: typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category; - CGAL_static_assertion((std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Left_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Bottom_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Top_side_category, Arr_oblivious_side_tag>::value || - std::is_same< Top_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Right_side_category, Arr_open_side_tag >::value)); + static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Left_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Bottom_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Top_side_category, Arr_oblivious_side_tag>::value || + std::is_same< Top_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Right_side_category, Arr_open_side_tag >::value); //@} /*! \struct diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index 438f46ced1c..ae87c8ddb28 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -77,10 +77,10 @@ public: typedef typename Traits_adaptor_2::Top_side_category Top_side_category; typedef typename Traits_adaptor_2::Right_side_category Right_side_category; - CGAL_static_assertion((Arr_sane_identified_tagging::value)); + Right_side_category>::value); public: typedef Arrangement_on_surface_2 diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h index 36f83a0e6a1..81f1c8bad04 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h @@ -67,10 +67,10 @@ protected: typedef typename Traits_adaptor_2::Top_side_category Top_side_category; typedef typename Traits_adaptor_2::Right_side_category Right_side_category; - CGAL_static_assertion((Arr_sane_identified_tagging::value)); + Right_side_category>::value); public: typedef ZoneVisitor_ Visitor; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp index 84896d26a68..81eae420496 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_tags.cpp @@ -272,38 +272,38 @@ int main () assert(ident12() == false); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_left_side_category< Traits5 >::Category, CGAL::Arr_oblivious_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_left_side_category< Traits1 >::Category, CGAL::Arr_open_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same::Category, CGAL::Arr_oblivious_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same::Category, CGAL::Arr_open_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_top_side_category< Traits5 >::Category, CGAL::Arr_oblivious_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_top_side_category< Traits1 >::Category, CGAL::Arr_open_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_right_side_category< Traits5 >::Category, CGAL::Arr_oblivious_side_tag >::value) ); - CGAL_static_assertion( + static_assert( (std::is_same< CGAL::internal::Arr_complete_right_side_category< Traits1 >::Category, CGAL::Arr_open_side_tag >::value) ); diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h index 331f8a0f44b..1dd6235a28c 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h @@ -49,10 +49,10 @@ public: typedef typename CGAL::GetVertexPointMap::type VPM; // usually will be true, but might not be the case if using custom type points -// CGAL_static_assertion((std::is_same::value_type>::value)); -// CGAL_static_assertion((std::is_same::type>::value)); +// static_assert(std::is_same::value_type>::value); +// static_assert(std::is_same::type>::value); typedef typename internal_np::Lookup_named_param_def< internal_np::vertex_normal_map_t, NamedParameters, diff --git a/BGL/include/CGAL/boost/graph/internal/Has_member_clear.h b/BGL/include/CGAL/boost/graph/internal/Has_member_clear.h index 9d0288d1171..c0e284b6574 100644 --- a/BGL/include/CGAL/boost/graph/internal/Has_member_clear.h +++ b/BGL/include/CGAL/boost/graph/internal/Has_member_clear.h @@ -29,7 +29,7 @@ public: }; template -CGAL_CPP17_INLINE constexpr bool Has_member_clear_v = Has_member_clear::value; +inline constexpr bool Has_member_clear_v = Has_member_clear::value; } // internal } // cgal diff --git a/BGL/test/BGL/test_Has_member_clear.cpp b/BGL/test/BGL/test_Has_member_clear.cpp index 5a78d9a2d7e..b8adc423eb7 100644 --- a/BGL/test/BGL/test_Has_member_clear.cpp +++ b/BGL/test/BGL/test_Has_member_clear.cpp @@ -19,13 +19,13 @@ struct with_clear_const { int main() { using namespace CGAL::internal; - CGAL_static_assertion(Has_member_clear::value); + static_assert(Has_member_clear::value); - CGAL_static_assertion(!Has_member_clear::value); + static_assert(!Has_member_clear::value); - CGAL_static_assertion(!Has_member_clear::value); + static_assert(!Has_member_clear::value); - CGAL_static_assertion(Has_member_clear::value); + static_assert(Has_member_clear::value); return 0; } diff --git a/BGL/test/BGL/test_Has_member_id.cpp b/BGL/test/BGL/test_Has_member_id.cpp index 6ff478d04c2..7cfec0bf8bd 100644 --- a/BGL/test/BGL/test_Has_member_id.cpp +++ b/BGL/test/BGL/test_Has_member_id.cpp @@ -28,17 +28,17 @@ int main() { using namespace CGAL::internal; - CGAL_static_assertion(!Has_member_id::value); - CGAL_static_assertion(Has_member_id::value); - CGAL_static_assertion(!Has_member_id::value); - CGAL_static_assertion(Has_member_id::value); - CGAL_static_assertion(Has_member_id::value); - CGAL_static_assertion( + static_assert(!Has_member_id::value); + static_assert(Has_member_id::value); + static_assert(!Has_member_id::value); + static_assert(Has_member_id::value); + static_assert(Has_member_id::value); + static_assert( (Has_member_id::Face>::value)); - CGAL_static_assertion(!Has_member_id >::value); - CGAL_static_assertion(Has_member_id >::value); - CGAL_static_assertion(Has_member_id >::value); + static_assert(!Has_member_id >::value); + static_assert(Has_member_id >::value); + static_assert(Has_member_id >::value); return 0; } diff --git a/BGL/test/BGL/test_Properties.cpp b/BGL/test/BGL/test_Properties.cpp index d932eb36d26..e05a0a7eba5 100644 --- a/BGL/test/BGL/test_Properties.cpp +++ b/BGL/test/BGL/test_Properties.cpp @@ -98,7 +98,7 @@ void test_vertex_index_map_uniqueness(const Graph& g, typedef typename CGAL::GetInitializedVertexIndexMap::const_type CVIM; // in the case where the map is passed by NP, its type doesn't depend on whether the mesh is const or not - static_assert((std::is_same::value), "VIM, CVIM must be the same type"); + static_assert(std::is_same::value, "VIM, CVIM must be the same type"); VIM ivim = CGAL::get_initialized_vertex_index_map(g, np); @@ -114,7 +114,7 @@ void test_halfedge_index_map_uniqueness(const Graph& g, typedef typename CGAL::GetInitializedHalfedgeIndexMap::const_type CHIM; // in the case where the map is passed by NP, its type doesn't depend on whether the mesh is const or not - static_assert((std::is_same::value), "HIM, CHIM must be the same type"); + static_assert(std::is_same::value, "HIM, CHIM must be the same type"); HIM ihim = CGAL::get_initialized_halfedge_index_map(g, np); @@ -130,7 +130,7 @@ void test_edge_index_map_uniqueness(const Graph& g, typedef typename CGAL::GetInitializedEdgeIndexMap::const_type CEIM; // in the case where the map is passed by NP, its type doesn't depend on whether the mesh is const or not - static_assert((std::is_same::value), "EIM, CEIM must be the same type"); + static_assert(std::is_same::value, "EIM, CEIM must be the same type"); EIM ieim = CGAL::get_initialized_edge_index_map(g, np); @@ -146,7 +146,7 @@ void test_face_index_map_uniqueness(const Graph& g, typedef typename CGAL::GetInitializedFaceIndexMap::const_type CFIM; // in the case where the map is passed by NP, its type doesn't depend on whether the mesh is const or not - static_assert((std::is_same::value), "FIM, CFIM must be the same type"); + static_assert(std::is_same::value, "FIM, CFIM must be the same type"); FIM ifim = CGAL::get_initialized_face_index_map(g, np); diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h index eeb80bf655d..8a0744933e3 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h @@ -123,14 +123,14 @@ public: typedef typename Arr::Right_side_category Right_side_category; // a side is either oblivious or open (unbounded) - CGAL_static_assertion((std::is_same::value || - std::is_same::value)); - CGAL_static_assertion((std::is_same::value || - std::is_same::value)); - CGAL_static_assertion((std::is_same::value || - std::is_same::value)); - CGAL_static_assertion((std::is_same::value || - std::is_same::value)); + static_assert(std::is_same::value || + std::is_same::value); + static_assert(std::is_same::value || + std::is_same::value); + static_assert(std::is_same::value || + std::is_same::value); + static_assert(std::is_same::value || + std::is_same::value); typedef typename Arr::Halfedge_handle Halfedge_handle; typedef typename Arr::Vertex_handle Vertex_handle; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h index c260e4cf824..d9d6f19c1c9 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h @@ -53,14 +53,14 @@ public: typedef typename Base::Right_side_category Right_side_category; // a side is either oblivious or open (unbounded) - CGAL_static_assertion((std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Left_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Bottom_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Top_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Top_side_category, Arr_open_side_tag >::value)); - CGAL_static_assertion((std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || - std::is_same< Right_side_category, Arr_open_side_tag >::value)); + static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Left_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Bottom_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Top_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Top_side_category, Arr_open_side_tag >::value); + static_assert(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value || + std::is_same< Right_side_category, Arr_open_side_tag >::value); class Ex_point_2 { diff --git a/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h b/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h index 31b1fb23dd0..43f4061a449 100644 --- a/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h +++ b/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h @@ -326,7 +326,7 @@ public: }; template -CGAL_CPP17_INLINE constexpr bool Has_member_report_v = Has_member_report::value; +inline constexpr bool Has_member_report_v = Has_member_report::value; template inline diff --git a/Box_intersection_d/include/CGAL/box_intersection_d.h b/Box_intersection_d/include/CGAL/box_intersection_d.h index a37ae5a98c7..b1bbe31ada5 100644 --- a/Box_intersection_d/include/CGAL/box_intersection_d.h +++ b/Box_intersection_d/include/CGAL/box_intersection_d.h @@ -63,8 +63,8 @@ void box_intersection_segment_tree_d( const NT sup = Box_intersection_d::box_limits::sup(); #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #else // CGAL_LINKED_WITH_TBB if(std::is_convertible::value) { diff --git a/Box_intersection_d/test/Box_intersection_d/test_Has_member_report.cpp b/Box_intersection_d/test/Box_intersection_d/test_Has_member_report.cpp index 12f64d1bc11..d3d5368f965 100644 --- a/Box_intersection_d/test/Box_intersection_d/test_Has_member_report.cpp +++ b/Box_intersection_d/test/Box_intersection_d/test_Has_member_report.cpp @@ -18,8 +18,8 @@ struct With_report_as_a_template_member_function { int main() { using CGAL::Box_intersection_d::Has_member_report; - CGAL_static_assertion(!Has_member_report::value); - CGAL_static_assertion(Has_member_report::value); - CGAL_static_assertion(Has_member_report::value); + static_assert(!Has_member_report::value); + static_assert(Has_member_report::value); + static_assert(Has_member_report::value); return EXIT_SUCCESS; } diff --git a/Circulator/include/CGAL/circulator.h b/Circulator/include/CGAL/circulator.h index 8b4f1d09b04..1c111779ef8 100644 --- a/Circulator/include/CGAL/circulator.h +++ b/Circulator/include/CGAL/circulator.h @@ -191,45 +191,45 @@ template inline void Assert_circulator( const C &) { typedef typename Circulator_traits::category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_iterator( const I &) { typedef typename Circulator_traits::category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_input_category( const I &/*i*/) { typedef typename std::iterator_traits::iterator_category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_output_category( const I &/*i*/) { typedef typename std::iterator_traits::iterator_category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_forward_category( const IC &/*ic*/) { typedef typename std::iterator_traits::iterator_category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_bidirectional_category( const IC &/*ic*/) { typedef typename std::iterator_traits::iterator_category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } template inline void Assert_random_access_category( const IC &/*ic*/) { typedef typename std::iterator_traits::iterator_category category; CGAL_USE_TYPE(category); - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); } // The assert at-least-category functions use the following // functions to resolve properly. Note the proper order of the diff --git a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp index 4611becf711..4b8bff71481 100644 --- a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp +++ b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp @@ -164,7 +164,7 @@ public: f (seed_start, sample_idxes, trees, samples, labels, params.n_in_bag_samples, split_generator); #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) diff --git a/Classification/include/CGAL/Classification/Local_eigen_analysis.h b/Classification/include/CGAL/Classification/Local_eigen_analysis.h index 33e1d706599..78606ed2749 100644 --- a/Classification/include/CGAL/Classification/Local_eigen_analysis.h +++ b/Classification/include/CGAL/Classification/Local_eigen_analysis.h @@ -265,7 +265,7 @@ public: out.m_content->mean_range = 0.; #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) @@ -353,7 +353,7 @@ public: out.m_content->mean_range = 0.; #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) @@ -431,7 +431,7 @@ public: #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) diff --git a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h index 2d30a534a42..7f16459723a 100644 --- a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h +++ b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h @@ -898,7 +898,7 @@ private: std::size_t gt = j; #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) diff --git a/Combinatorial_map/include/CGAL/Cell_iterators.h b/Combinatorial_map/include/CGAL/Cell_iterators.h index b54c12bf0c0..93104ba01e2 100644 --- a/Combinatorial_map/include/CGAL/Cell_iterators.h +++ b/Combinatorial_map/include/CGAL/Cell_iterators.h @@ -82,8 +82,8 @@ namespace CGAL { Ite(amap, adart, amap.get_new_mark()), mcell_mark_number(amap.get_new_mark()) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mcell_mark_number)); mark_cell(amap, adart, mcell_mark_number); @@ -196,8 +196,8 @@ namespace CGAL { Ite(amap, adart), mmark_number(amap.get_new_mark()) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); mark_cell(amap, adart, mmark_number); } @@ -303,8 +303,8 @@ namespace CGAL { Base(amap), mmark_number(amap.get_new_mark()) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); mark_cell(amap, (*this), mmark_number); } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 229a8d1a47d..e2145afb1f3 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -185,7 +185,7 @@ namespace CGAL { */ Combinatorial_map_base() { - CGAL_static_assertion_msg(Helper::nb_attribs<=dimension+1, + static_assert(Helper::nb_attribs<=dimension+1, "Too many attributes in the tuple Attributes_enabled"); this->init_storage(); @@ -803,7 +803,7 @@ namespace CGAL { void restricted_set_dart_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "set_dart_attribute called but i-attributes are disabled."); if ( this->template attribute(dh)==ah ) return; @@ -826,7 +826,7 @@ namespace CGAL { void set_dart_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "set_dart_attribute called but i-attributes are disabled."); if ( this->template attribute(dh)==ah ) return; @@ -1524,8 +1524,8 @@ namespace CGAL { template < class Ite > std::ostream& display_orbits(std::ostream & aos) const { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); unsigned int nb = 0; size_type amark = get_new_mark(); for ( typename Dart_range::const_iterator it1(darts().begin()), @@ -1584,7 +1584,7 @@ namespace CGAL { template typename Attribute_descriptor::type create_attribute(const Args&... args) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "create_attribute but i-attributes are disabled"); typename Attribute_descriptor::type res= std::get::value> @@ -1602,7 +1602,7 @@ namespace CGAL { template void erase_attribute(typename Attribute_descriptor::type h) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "erase_attribute but i-attributes are disabled"); std::get::value> (mattribute_containers).erase(h); @@ -1612,7 +1612,7 @@ namespace CGAL { template bool is_attribute_used(typename Attribute_const_descriptor< i >::type ah) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "is_attribute_used but i-attributes are disabled"); return std::get::value> (mattribute_containers).is_used(ah); @@ -1622,7 +1622,7 @@ namespace CGAL { template size_type number_of_attributes() const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "number_of_attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers).size(); @@ -1636,8 +1636,8 @@ namespace CGAL { void set_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion(i<=dimension); - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(i<=dimension); + static_assert(Helper::template Dimension_index::value>=0, "set_attribute but i-attributes are disabled"); for ( typename Dart_of_cell_range::iterator it(*this, dh); it.cont(); ++it) @@ -1651,7 +1651,7 @@ namespace CGAL { template typename Attribute_range::type & attributes() { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers); @@ -1660,7 +1660,7 @@ namespace CGAL { template typename Attribute_const_range::type & attributes() const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers); @@ -1673,7 +1673,7 @@ namespace CGAL { typename Attribute_type::type&)>& onsplit_functor() { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1689,7 +1689,7 @@ namespace CGAL { typename Attribute_type::type&)>& onsplit_functor() const { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1705,7 +1705,7 @@ namespace CGAL { typename Attribute_type::type&)>& onmerge_functor() { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1720,7 +1720,7 @@ namespace CGAL { typename Attribute_type::type&)>& onmerge_functor() const { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h index 06f3c4f4dc3..2b55a2c21c9 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_group_functors.h @@ -64,9 +64,9 @@ struct Group_nonvoid_attribute_functor_of_dart_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2) { - CGAL_static_assertion( 1<=i && i<=CMap::dimension ); - CGAL_static_assertion( i!=j && (i!=1 || j!=0) ); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert( 1<=i && i<=CMap::dimension ); + static_assert( i!=j && (i!=1 || j!=0) ); + static_assert(CMap::Helper::template Dimension_index::value>=0, "Group_attribute_functor_of_dart_run but " "i-attributes are disabled"); @@ -90,8 +90,8 @@ struct Group_nonvoid_attribute_functor_of_dart_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2) { - CGAL_static_assertion(j!=0 && j!=1); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(j!=0 && j!=1); + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_of_dart_run<0> but " "0-attributes are disabled"); @@ -127,7 +127,7 @@ struct Group_nonvoid_attribute_functor_of_dart_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_of_dart_run<0> but " "0-attributes are disabled"); @@ -152,7 +152,7 @@ struct Group_nonvoid_attribute_functor_of_dart_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_of_dart_run<0> but " "0-attributes are disabled"); @@ -240,9 +240,9 @@ struct Group_nonvoid_attribute_functor_run typename CMap::Dart_descriptor adart1, typename CMap::Dart_descriptor adart2) { - CGAL_static_assertion( 1<=i && i<=CMap::dimension ); - CGAL_static_assertion( i!=j ); - CGAL_static_assertion_msg + static_assert( 1<=i && i<=CMap::dimension ); + static_assert( i!=j ); + static_assert ( CMap::Helper::template Dimension_index::value>=0, "Group_attribute_functor_run but i-attributes are disabled" ); typename CMap::template Attribute_descriptor::type @@ -279,10 +279,10 @@ struct Group_nonvoid_attribute_functor_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2 ) { - CGAL_static_assertion_msg + static_assert ( CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_run<0> but 0-attributes are disabled" ); - CGAL_static_assertion(j!=0 && j!=1); + static_assert(j!=0 && j!=1); typename CMap::template Attribute_descriptor<0>::type a1=CMap::null_descriptor, a2=CMap::null_descriptor; @@ -340,7 +340,7 @@ struct Group_nonvoid_attribute_functor_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2 ) { - CGAL_static_assertion_msg + static_assert ( CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_run<0> but 0-attributes are disabled" ); typename CMap::Dart_descriptor od=amap.other_extremity(dh2); @@ -377,7 +377,7 @@ struct Group_nonvoid_attribute_functor_run typename CMap::Dart_descriptor dh1, typename CMap::Dart_descriptor dh2 ) { - CGAL_static_assertion_msg + static_assert ( CMap::Helper::template Dimension_index<0>::value>=0, "Group_attribute_functor_run<0> but 0-attributes are disabled" ); typename CMap::Dart_descriptor od =amap.other_extremity(dh1); @@ -474,9 +474,9 @@ struct Degroup_nonvoid_attribute_functor_run typename CMap::Dart_descriptor adart1, typename CMap::Dart_descriptor adart2) { - CGAL_static_assertion( i<=CMap::dimension ); - CGAL_static_assertion( i!=j ); - CGAL_static_assertion_msg + static_assert( i<=CMap::dimension ); + static_assert( i!=j ); + static_assert ( CMap::Helper::template Dimension_index::value>=0, "Degroup_attribute_functor_run but i-attributes are disabled" ); @@ -549,7 +549,7 @@ void test_split_attribute_functor_one_dart unsigned int, typename CMap::Hash_function> & found_attributes, typename CMap::size_type mark ) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Test_split_attribute_functor_one_dart but " "i-attributes are disabled"); @@ -615,9 +615,9 @@ struct Test_split_nonvoid_attribute_functor_run &modified_darts, typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK) { - CGAL_static_assertion( 1<=i && i<=CMap::dimension ); + static_assert( 1<=i && i<=CMap::dimension ); CGAL_assertion( i!=j ); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Test_split_attribute_functor_run but " "i-attributes are disabled"); @@ -658,9 +658,9 @@ struct Test_split_nonvoid_attribute_functor_run &modified_darts2, typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK) { - CGAL_static_assertion( 1<=i && i<=CMap::dimension ); + static_assert( 1<=i && i<=CMap::dimension ); CGAL_assertion( i!=j ); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Test_split_attribute_functor_run but " "i-attributes are disabled"); @@ -720,7 +720,7 @@ struct Test_split_nonvoid_attribute_functor_run typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK) { CGAL_assertion( j!=0 && j!=1 ); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Test_split_attribute_functor_run<0> but " "0-attributes are disabled"); @@ -772,7 +772,7 @@ struct Test_split_nonvoid_attribute_functor_run typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK) { CGAL_assertion( j!=0 && j!=1 ); - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Test_split_attribute_functor_run<0> but " "0-attributes are disabled"); @@ -858,7 +858,7 @@ struct Test_split_nonvoid_attribute_functor_run &modified_darts2, typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index<0>::value>=0, "Test_split_attribute_functor_run<0> but " "0-attributes are disabled"); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h index 3e0b147942c..c76a210ae6f 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_internal_functors.h @@ -220,7 +220,7 @@ struct Test_is_valid_attribute_functor typename CMap::Dart_const_descriptor adart, std::vector& marks, bool& ares) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Test_is_valid_attribute_functor but " " i-attributes are disabled"); @@ -304,7 +304,7 @@ struct Correct_invalid_attributes_functor typename CMap::Dart_descriptor adart, std::vector& marks) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Correct_invalid_attributes_functor but " " i-attributes are disabled"); @@ -362,7 +362,7 @@ struct Cleanup_useless_attributes template static void run(CMap& amap) { - CGAL_static_assertion_msg(CMap::Helper::template + static_assert(CMap::Helper::template Dimension_index::value>=0, "Cleanup_useless_attributes but " " i-attributes are disabled"); @@ -707,7 +707,7 @@ struct Test_is_same_attribute_point_functor typename Map1::Dart_const_descriptor dh1, typename Map2::Dart_const_descriptor dh2) { - CGAL_static_assertion( Withpoint1==true && Withpoint2==true ); + static_assert( Withpoint1==true && Withpoint2==true ); if (m1.template attribute(dh1)==Map1::null_descriptor && m2.template attribute(dh2)==Map2::null_descriptor) return true; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h index b7974062ae0..7cb121ff1d8 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h @@ -34,8 +34,8 @@ namespace CGAL typename Map::Dart_const_descriptor adart1, typename Map::Dart_const_descriptor adart2) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); bool found=false; for (Iterator it(amap, adart1); !found && it.cont(); ++it) @@ -57,8 +57,8 @@ namespace CGAL typename Map::Dart_const_descriptor adart, typename Map::size_type amark) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); bool res=true; for ( Iterator it(amap, adart); res && it.cont(); ++it ) @@ -98,8 +98,8 @@ namespace CGAL typename Map::Dart_const_descriptor adart, typename Map::size_type amark) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion( (is_whole_orbit_unmarked > (amap, adart, amark)) ); @@ -305,8 +305,8 @@ namespace CGAL typename Map::size_type amark, typename Map::size_type amark2=Map::INVALID_MARK) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion( (is_whole_orbit_unmarked > (amap, adart, amark)) ); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index 0b2c39bc720..a50266f7659 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -305,8 +305,8 @@ namespace CGAL { typedef typename Map::size_type size_type; - CGAL_static_assertion( (Bi<=Map::dimension && - std::is_same::value) ); + static_assert(Bi<=Map::dimension && + std::is_same::value); public: /// Main constructor. @@ -493,8 +493,8 @@ namespace CGAL { typedef typename Map::size_type size_type; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); /// Main constructor. CMap_non_basic_iterator(Map& amap, Dart_descriptor adart1): @@ -579,8 +579,8 @@ namespace CGAL { /// True iff this iterator is basic typedef Tag_false Basic_iterator; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); /// Main constructor. CMap_non_basic_iterator(Map& amap, Dart_descriptor adart): diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h index 2ba09b32650..6a7a1b6f271 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h @@ -77,7 +77,7 @@ namespace CGAL static size_t run(CMap& amap, typename CMap::Dart_descriptor adart, bool update_attributes) { - CGAL_static_assertion ( 1<=i && i(adart)) ); size_t res = 0; @@ -493,7 +493,7 @@ namespace CGAL static size_t run(CMap& amap, typename CMap::Dart_descriptor adart, bool update_attributes) { - CGAL_static_assertion ( 2<=i && i<=CMap::dimension ); + static_assert ( 2<=i && i<=CMap::dimension ); CGAL_assertion( (amap.template is_contractible(adart)) ); size_t res = 0; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h index cde06788e0d..8de6b7c1f7f 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h @@ -64,7 +64,7 @@ namespace CGAL { typedef typename Dart_container::size_type size_type; typedef std::nullptr_t Null_descriptor_type; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_descriptor=nullptr; + inline static constexpr Null_descriptor_type null_descriptor=nullptr; using Type_for_compact_container=void*; @@ -107,7 +107,7 @@ namespace CGAL { template using Attribute_const_handle=Attribute_const_descriptor; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_handle=null_descriptor; + inline static constexpr Null_descriptor_type null_handle=null_descriptor; /// Number of marks static const size_type NB_MARKS = 32; @@ -232,7 +232,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -241,7 +241,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -252,7 +252,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); typename Attribute_descriptor::type res= std::get::value> @@ -467,16 +467,6 @@ namespace CGAL { typename Helper::Attribute_containers mattribute_containers; }; -#ifndef CGAL_CXX17 - template - constexpr typename Combinatorial_map_storage_1::Null_descriptor_type - Combinatorial_map_storage_1::null_descriptor; - - template - constexpr typename Combinatorial_map_storage_1::Null_descriptor_type - Combinatorial_map_storage_1::null_handle; -#endif - } // namespace CGAL #if defined(BOOST_GCC) 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 584442412c5..f1e3d62cbab 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages_with_index.h @@ -266,7 +266,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -275,7 +275,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -286,7 +286,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); // We need to do a reserve before the emplace in order to avoid a bug of // invalid reference when the container is reallocated. diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index 3308def6103..17ffde4b294 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -226,7 +226,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute() { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mattribute_descriptors); @@ -234,7 +234,7 @@ namespace CGAL { template typename Attribute_const_descriptor::type attribute() const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mattribute_descriptors); diff --git a/Combinatorial_map/include/CGAL/Dart_iterators.h b/Combinatorial_map/include/CGAL/Dart_iterators.h index c73a32b383e..2e552f25950 100644 --- a/Combinatorial_map/include/CGAL/Dart_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_iterators.h @@ -295,13 +295,13 @@ namespace CGAL { /// Main constructor. CMap_dart_iterator_basic_of_orbit_generic(Map& amap, Dart_descriptor adart): Base(amap, adart) - { CGAL_static_assertion( Bi>=2 && Bi<=Map::dimension ); } + { static_assert( Bi>=2 && Bi<=Map::dimension ); } /// Main constructor. CMap_dart_iterator_basic_of_orbit_generic(Map& amap, Dart_descriptor adart, size_type /*amark*/): Base(amap, adart) - { CGAL_static_assertion( Bi>=2 && Bi<=Map::dimension ); } + { static_assert( Bi>=2 && Bi<=Map::dimension ); } /// Prefix ++ operator. Self& operator++() @@ -346,7 +346,7 @@ namespace CGAL { typedef Tag_false Use_mark; - CGAL_static_assertion( Bi>1 && delta>1 && Bi+delta<=Map::dimension ); + static_assert( Bi>1 && delta>1 && Bi+delta<=Map::dimension ); public: /// Main constructor. @@ -460,7 +460,7 @@ namespace CGAL { typedef Tag_true Use_mark; - CGAL_static_assertion( 2<=Map::dimension ); + static_assert( 2<=Map::dimension ); public: /// Main constructor. @@ -493,7 +493,7 @@ namespace CGAL { typedef Tag_true Use_mark; - CGAL_static_assertion( 2<=Map::dimension ); + static_assert( 2<=Map::dimension ); public: /// Main constructor. @@ -524,7 +524,7 @@ namespace CGAL { typedef Tag_false Use_mark; - CGAL_static_assertion( delta>1 && delta<=Map::dimension ); + static_assert( delta>1 && delta<=Map::dimension ); public: /// Main constructor. @@ -625,7 +625,7 @@ namespace CGAL { typedef Tag_false Use_mark; - CGAL_static_assertion( delta>1 && delta+1<=Map::dimension ); + static_assert( delta>1 && delta+1<=Map::dimension ); public: /// Main constructor. @@ -726,7 +726,7 @@ namespace CGAL { typedef Tag_false Use_mark; - CGAL_static_assertion( Bi>1 && Bi+1<=Map::dimension ); + static_assert( Bi>1 && Bi+1<=Map::dimension ); public: /// Main constructor. @@ -1026,7 +1026,7 @@ namespace CGAL { typedef Tag_true Use_mark; - CGAL_static_assertion( i>1 && i<=Map::dimension+1 ); + static_assert( i>1 && i<=Map::dimension+1 ); public: /// Main constructor. diff --git a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp index 90bf87cfa8c..269c14995bc 100644 --- a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp @@ -23,12 +23,12 @@ using namespace CGAL::Convex_hull_3::internal; int main() { - CGAL_static_assertion( (std::is_same::type>::value) ); - CGAL_static_assertion( (std::is_same::type>::value) ); - CGAL_static_assertion( (std::is_same::type>::value) ); - CGAL_static_assertion( (std::is_same::type>::value) ); - CGAL_static_assertion( (std::is_same::type>::value) ); - CGAL_static_assertion( (std::is_same,Default_traits_for_Chull_3::type>::value) ); - CGAL_static_assertion( (std::is_same, std::true_type >::Protector,CGAL::Protect_FPU_rounding >::value) ); + static_assert(std::is_same::type>::value); + static_assert(std::is_same::type>::value); + static_assert(std::is_same::type>::value); + static_assert(std::is_same::type>::value); + static_assert(std::is_same::type>::value); + static_assert(std::is_same,Default_traits_for_Chull_3::type>::value); + static_assert(std::is_same, std::true_type >::Protector,CGAL::Protect_FPU_rounding >::value); return 0; } diff --git a/Documentation/doc/Documentation/Preliminaries.txt b/Documentation/doc/Documentation/Preliminaries.txt index 1fccdc134f9..2e2ae95e661 100644 --- a/Documentation/doc/Documentation/Preliminaries.txt +++ b/Documentation/doc/Documentation/Preliminaries.txt @@ -39,10 +39,9 @@ If you are using CMake, then you can set the CMake option `CGAL_HAS_NO_THREADS` `TRUE`. In addition to defining the preprocessor macro `CGAL_HAS_NO_THREADS`, it will also avoid CMake to link with the native threads support library on your system. -\section Preliminaries_cc0x C++14 Support +\section Preliminaries_cc0x C++17 Support -After being based on the \CC standard released in 1998 (and later refined in 2003) for a long time, -\cgal is now based on a newer major version of the standard, C++14. +\cgal is based on the version C++17 of the C++ standard. \section preliminaries_secchecks Checks diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index 2d6382b3c17..d55d10c2cbe 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -6,7 +6,7 @@ \section seccompilers Supported Compilers In order to build a program using \cgal, you need a \cpp compiler -supporting C++14 or later. +supporting C++17 or later. \cgal \cgalReleaseNumber is supported (continuously tested) for the following compilers/operating systems: | Operating System | Compiler | @@ -14,9 +14,9 @@ supporting C++14 or later. | Linux | \gnu `g++` 11.3.0 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | | | `Clang` \cgalFootnote{\cgalFootnoteCode{https://clang.llvm.org/}} compiler version 15.0.7 | | \ms Windows | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | -| | \ms Visual `C++` 14.0, 15.9, 16.10, 17.0 (\visualstudio 2015, 2017, 2019, and 2022)\cgalFootnote{\cgalFootnoteCode{https://visualstudio.microsoft.com/}} | +| | \ms Visual `C++` 15.9, 16.10, 17.0 (\visualstudio 2017, 2019, and 2022)\cgalFootnote{\cgalFootnoteCode{https://visualstudio.microsoft.com/}} | | MacOS X | \gnu `g++` 11.3.0 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | -| | Apple `Clang` compiler versions 10.0.1, and 12.0.5. | +| | Apple `Clang` compiler versions 10.0.1, 12.0.5, and 13.0.0 | diff --git a/Documentation/doc/Documentation/windows.txt b/Documentation/doc/Documentation/windows.txt index c4daa8fc380..d40059d76cd 100644 --- a/Documentation/doc/Documentation/windows.txt +++ b/Documentation/doc/Documentation/windows.txt @@ -3,7 +3,7 @@ \cgalAutoToc \cgal \cgalReleaseNumber is supported for the following \ms Visual `C++` compilers: -14.0, 15.9, 16.0, 17.0 (\visualstudio 2015, 2017, 2019, and 2022). +15.9, 16.0, 17.0 (\visualstudio 2017, 2019, and 2022). \cgal is a library that has mandatory dependencies that must be first installed: \ref thirdpartyBoost and \ref thirdpartyMPFR. diff --git a/Generalized_map/include/CGAL/GMap_cell_iterators.h b/Generalized_map/include/CGAL/GMap_cell_iterators.h index a3851f2c297..55dbbff8308 100644 --- a/Generalized_map/include/CGAL/GMap_cell_iterators.h +++ b/Generalized_map/include/CGAL/GMap_cell_iterators.h @@ -70,8 +70,8 @@ namespace CGAL { Base(amap), mmark_number(amap.get_new_mark()) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); mark_cell(amap, (*this), mmark_number); } @@ -183,8 +183,8 @@ namespace CGAL { Base(amap), mmark_number(amap.get_new_mark()) { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); CGAL_assertion(amap.is_whole_map_unmarked(mmark_number)); mark_cell(amap, (*this), mmark_number); } diff --git a/Generalized_map/include/CGAL/GMap_dart_iterators.h b/Generalized_map/include/CGAL/GMap_dart_iterators.h index 600288df844..b2eaaf97b70 100644 --- a/Generalized_map/include/CGAL/GMap_dart_iterators.h +++ b/Generalized_map/include/CGAL/GMap_dart_iterators.h @@ -96,7 +96,7 @@ namespace CGAL { typedef Tag_false Use_mark; ///< True iff this iterator uses mark - CGAL_static_assertion( Ai>=0 && Ai<=Map::dimension ); + static_assert( Ai>=0 && Ai<=Map::dimension ); public: /// Main constructor. @@ -154,7 +154,7 @@ namespace CGAL { typedef Tag_false Use_mark; ///< True iff this iterator uses mark typedef Tag_true Basic_iterator; ///< True iff this iterator is basic - CGAL_static_assertion( (0<=Ai && Ai+delta<=Map::dimension && delta>1) ); + static_assert(0<=Ai && Ai+delta<=Map::dimension && delta>1); public: /// Main constructor. @@ -269,7 +269,7 @@ namespace CGAL { typedef Tag_false Use_mark; ///< True iff this iterator uses mark typedef Tag_true Basic_iterator; ///< True iff this iterator is basic - CGAL_static_assertion(0<=Ai && Ai+1<=Map_::dimension); + static_assert(0<=Ai && Ai+1<=Map_::dimension); public: /// Main constructor. @@ -468,9 +468,9 @@ namespace CGAL { typedef Tag_false Use_mark; ///< True iff this iterator uses mark typedef Tag_true Basic_iterator; ///< True iff this iterator is basic - CGAL_static_assertion( (0<=Ai && delta11) ); + delta1>1); public: /// Main constructor. @@ -508,7 +508,7 @@ namespace CGAL { typedef Tag_true Basic_iterator; ///< True iff this iterator is basic - CGAL_static_assertion( Ai=0 && i<=Map::dimension+1 ); + static_assert( i>=0 && i<=Map::dimension+1 ); public: /// Main constructor. diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 3e0f077a989..d7f75bd151a 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -161,7 +161,7 @@ namespace CGAL { */ Generalized_map_base() { - CGAL_static_assertion_msg(Helper::nb_attribs<=dimension+1, + static_assert(Helper::nb_attribs<=dimension+1, "Too many attributes in the tuple Attributes_enabled"); this->init_storage(); @@ -689,7 +689,7 @@ namespace CGAL { void restricted_set_dart_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "set_dart_attribute called but i-attributes are disabled."); if ( this->template attribute(dh)==ah ) return; @@ -712,7 +712,7 @@ namespace CGAL { void set_dart_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "set_dart_attribute called but i-attributes are disabled."); if ( this->template attribute(dh)==ah ) return; @@ -1347,8 +1347,8 @@ namespace CGAL { template < class Ite > std::ostream& display_orbits(std::ostream & aos) const { - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); unsigned int nb = 0; size_type amark = get_new_mark(); for ( typename Dart_range::const_iterator it1(darts().begin()), @@ -1409,7 +1409,7 @@ namespace CGAL { template typename Attribute_descriptor::type create_attribute(const Args&... args) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "create_attribute but i-attributes are disabled"); typename Attribute_descriptor::type res= std::get::value> @@ -1427,7 +1427,7 @@ namespace CGAL { template void erase_attribute(typename Attribute_descriptor::type h) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "erase_attribute but i-attributes are disabled"); std::get::value> (mattribute_containers).erase(h); @@ -1437,7 +1437,7 @@ namespace CGAL { template bool is_attribute_used(typename Attribute_const_descriptor< i >::type ah) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "is_attribute_used but i-attributes are disabled"); return std::get::value> (mattribute_containers).is_used(ah); @@ -1447,7 +1447,7 @@ namespace CGAL { template size_type number_of_attributes() const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "number_of_attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers).size(); @@ -1461,8 +1461,8 @@ namespace CGAL { void set_attribute(Dart_descriptor dh, typename Attribute_descriptor::type ah) { - CGAL_static_assertion(i<=dimension); - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(i<=dimension); + static_assert(Helper::template Dimension_index::value>=0, "set_attribute but i-attributes are disabled"); for ( typename Dart_of_cell_range::iterator it(*this, dh); it.cont(); ++it) @@ -1476,7 +1476,7 @@ namespace CGAL { template typename Attribute_range::type & attributes() { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers); @@ -1485,7 +1485,7 @@ namespace CGAL { template typename Attribute_const_range::type & attributes() const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); return std::get::value> (mattribute_containers); @@ -1498,7 +1498,7 @@ namespace CGAL { typename Attribute_type::type&)>& onsplit_functor() { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1514,7 +1514,7 @@ namespace CGAL { typename Attribute_type::type&)>& onsplit_functor() const { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1530,7 +1530,7 @@ namespace CGAL { typename Attribute_type::type&)>& onmerge_functor() { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); @@ -1545,7 +1545,7 @@ namespace CGAL { typename Attribute_type::type&)>& onmerge_functor() const { - CGAL_static_assertion_msg + static_assert (Helper::template Dimension_index::value>=0, "onsplit_functor but " "i-attributes are disabled"); diff --git a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h index 4a15c8ea733..4b3c17816e4 100644 --- a/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h +++ b/Generalized_map/include/CGAL/Generalized_map/internal/Generalized_map_group_functors.h @@ -65,9 +65,9 @@ struct GMap_group_attribute_functor_of_dart_run typename GMap::Dart_descriptor dh1, typename GMap::Dart_descriptor dh2) { - CGAL_static_assertion( i<=GMap::dimension ); - CGAL_static_assertion( i!=j ); - CGAL_static_assertion_msg(GMap::Helper::template + static_assert( i<=GMap::dimension ); + static_assert( i!=j ); + static_assert(GMap::Helper::template Dimension_index::value>=0, "GMap_group_attribute_functor_of_dart_run but " "i-attributes are disabled"); @@ -134,9 +134,9 @@ struct GMap_group_attribute_functor_run typename GMap::Dart_descriptor adart1, typename GMap::Dart_descriptor adart2) { - CGAL_static_assertion( i<=GMap::dimension ); - CGAL_static_assertion( i!=j ); - CGAL_static_assertion_msg + static_assert( i<=GMap::dimension ); + static_assert( i!=j ); + static_assert ( GMap::Helper::template Dimension_index::value>=0, "GMap_group_attribute_functor_run but i-attributes are disabled" ); typename GMap::template Attribute_descriptor::type @@ -212,9 +212,9 @@ struct GMap_degroup_attribute_functor_run typename GMap::Dart_descriptor adart1, typename GMap::Dart_descriptor adart2) { - CGAL_static_assertion( i<=GMap::dimension ); - CGAL_static_assertion( i!=j ); - CGAL_static_assertion_msg + static_assert( i<=GMap::dimension ); + static_assert( i!=j ); + static_assert ( GMap::Helper::template Dimension_index::value>=0, "GMap_degroup_attribute_functor_run but i-attributes are disabled" ); @@ -276,7 +276,7 @@ void GMap_test_split_attribute_functor_one_dart unsigned int, typename GMap::Hash_function> & found_attributes, typename GMap::size_type mark ) { - CGAL_static_assertion_msg(GMap::Helper::template + static_assert(GMap::Helper::template Dimension_index::value>=0, "GMap_test_split_attribute_functor_one_dart but " "i-attributes are disabled"); @@ -340,9 +340,9 @@ struct GMap_test_split_attribute_functor_run &modified_darts, typename GMap::size_type mark_modified_darts=GMap::INVALID_MARK) { - CGAL_static_assertion( i<=GMap::dimension ); + static_assert( i<=GMap::dimension ); CGAL_assertion( i!=j ); - CGAL_static_assertion_msg(GMap::Helper::template + static_assert(GMap::Helper::template Dimension_index::value>=0, "GMap_test_split_attribute_functor_run but " "i-attributes are disabled"); @@ -383,9 +383,9 @@ struct GMap_test_split_attribute_functor_run &modified_darts2, typename GMap::size_type mark_modified_darts=GMap::INVALID_MARK) { - CGAL_static_assertion( i<=GMap::dimension ); + static_assert( i<=GMap::dimension ); CGAL_assertion( i!=j ); - CGAL_static_assertion_msg(GMap::Helper::template + static_assert(GMap::Helper::template Dimension_index::value>=0, "GMap_test_split_attribute_functor_run but " "i-attributes are disabled"); diff --git a/Generalized_map/include/CGAL/Generalized_map_iterators_base.h b/Generalized_map/include/CGAL/Generalized_map_iterators_base.h index 15f5bb484bf..034b1600f93 100644 --- a/Generalized_map/include/CGAL/Generalized_map_iterators_base.h +++ b/Generalized_map/include/CGAL/Generalized_map_iterators_base.h @@ -59,8 +59,8 @@ namespace CGAL { typedef Tag_true Use_mark; - CGAL_static_assertion( (Ai<=Map::dimension && - std::is_same::value) ); + static_assert(Ai<=Map::dimension && + std::is_same::value); public: /// Main constructor. diff --git a/Generalized_map/include/CGAL/Generalized_map_operations.h b/Generalized_map/include/CGAL/Generalized_map_operations.h index 8366f3495df..0ebec7a7c5c 100644 --- a/Generalized_map/include/CGAL/Generalized_map_operations.h +++ b/Generalized_map/include/CGAL/Generalized_map_operations.h @@ -73,7 +73,7 @@ namespace CGAL static size_t run(GMap& amap, typename GMap::Dart_descriptor adart, bool update_attributes) { - CGAL_static_assertion ( i(adart)) ); size_t res = 0; @@ -292,7 +292,7 @@ namespace CGAL static size_t run(GMap& amap, typename GMap::Dart_descriptor adart, bool update_attributes) { - CGAL_static_assertion ( 1<=i && i<=GMap::dimension ); + static_assert ( 1<=i && i<=GMap::dimension ); CGAL_assertion( (amap.template is_contractible(adart)) ); size_t res = 0; diff --git a/Generalized_map/include/CGAL/Generalized_map_storages.h b/Generalized_map/include/CGAL/Generalized_map_storages.h index d628b153a5e..469741cbb16 100644 --- a/Generalized_map/include/CGAL/Generalized_map_storages.h +++ b/Generalized_map/include/CGAL/Generalized_map_storages.h @@ -64,7 +64,7 @@ namespace CGAL { typedef typename Dart_container::size_type size_type; typedef std::nullptr_t Null_descriptor_type; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_descriptor=nullptr; + inline static constexpr Null_descriptor_type null_descriptor=nullptr; using Type_for_compact_container=void*; @@ -107,7 +107,7 @@ namespace CGAL { template using Attribute_const_handle=Attribute_const_descriptor; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_handle=null_descriptor; + inline static constexpr Null_descriptor_type null_handle=null_descriptor; /// Number of marks static const size_type NB_MARKS = 32; @@ -229,7 +229,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -238,7 +238,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -249,7 +249,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); typename Attribute_descriptor::type res= std::get::value> @@ -457,17 +457,6 @@ namespace CGAL { /// Tuple of attributes containers typename Helper::Attribute_containers mattribute_containers; }; - -#ifndef CGAL_CXX17 - template - constexpr typename Generalized_map_storage_1::Null_descriptor_type - Generalized_map_storage_1::null_descriptor; - - template - constexpr typename Generalized_map_storage_1::Null_descriptor_type - Generalized_map_storage_1::null_handle; -#endif - } // namespace CGAL #if defined(BOOST_GCC) diff --git a/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h b/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h index 828004b8416..ffd867477f2 100644 --- a/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h +++ b/Generalized_map/include/CGAL/Generalized_map_storages_with_index.h @@ -220,7 +220,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -229,7 +229,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -240,7 +240,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); // We need to do a reserve before the emplace in order to avoid a bug of // invalid reference when the container is reallocated. diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 0dead11c3ca..330e5005d53 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -752,8 +752,8 @@ class Surface_mesh_geodesic_distances_3 > #endif { - CGAL_static_assertion((std::is_same::value) || - (std::is_same::value)); + static_assert(std::is_same::value || + std::is_same::value); // extract real types from Default #ifdef CGAL_EIGEN3_ENABLED diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 7ad317b6709..388f336227b 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,6 +1,17 @@ Release History =============== +[Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0) +----------- + +Release date: October 2023 + +### General Changes + +- **Breaking change**: C++17 is now required +- Support for Visual `C++` 14.0 (Visual studio 2015) is dropped. + + [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index fd8997d5f0d..00ce9e422de 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -946,7 +946,7 @@ ${Qt5Widgets_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Gui_DEFINITIONS} \ ${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \ ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS} \ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \ -${CGAL_DEFINITIONS}") +${CGAL_DEFINITIONS} -std=c++17") message("COMPILATION OPTIONS ARE : ${compile_options}") if(NOT RS_FOUND AND NOT RS3_FOUND) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 7329be33116..355bde0dd6d 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -97,9 +97,6 @@ function(CGAL_setup_CGAL_dependencies target) target_compile_definitions(${target} INTERFACE CGAL_TEST_SUITE=1) endif() - # CGAL now requires C++14. `decltype(auto)` is used as a marker of C++14. - target_compile_features(${target} INTERFACE cxx_decltype_auto) - use_CGAL_Boost_support(${target} INTERFACE) # Make CGAL depend on threads-support (for Epeck and Epeck_d) @@ -119,6 +116,13 @@ function(CGAL_setup_CGAL_dependencies target) target_link_options(${target} INTERFACE -fsanitize=address) endif() # Now setup compilation flags + CGAL_setup_CGAL_flags(${target}) +endfunction() + +function(CGAL_setup_CGAL_flags target) + # CGAL now requires C++17 + target_compile_features(${target} INTERFACE cxx_std_17) + if(MSVC) target_compile_options(${target} INTERFACE "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") @@ -127,11 +131,6 @@ function(CGAL_setup_CGAL_dependencies target) $<$:/fp:except-> $<$:/bigobj> # Use /bigobj by default ) - if(MSVC_TOOLSET_VERSION VERSION_LESS_EQUAL 140) # for MSVC 2015 - target_compile_options(${target} INTERFACE - $<$:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded" - ) - endif() elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected") diff --git a/Installation/include/CGAL/Installation/internal/deprecation_warning.h b/Installation/include/CGAL/Installation/internal/deprecation_warning.h index 0206b562974..6601ff23520 100644 --- a/Installation/include/CGAL/Installation/internal/deprecation_warning.h +++ b/Installation/include/CGAL/Installation/internal/deprecation_warning.h @@ -71,7 +71,7 @@ #endif #if defined(CGAL_NO_DEPRECATED_CODE) // No deprecated code. -CGAL_static_assertion_msg(false, CGAL_INTERNAL_DEPRECATED_MESSAGE); +static_assert(false, CGAL_INTERNAL_DEPRECATED_MESSAGE); #elif !defined(CGAL_NO_DEPRECATION_WARNINGS) // don't trigger on NO_DEPRECATION_WARNINGS # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) # pragma message (CGAL_INTERNAL_DEPRECATED_MESSAGE) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index af4a81c8607..c7062d61cae 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -36,11 +36,6 @@ # define WIN64 #endif -#ifdef _MSC_VER -#define _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING 1 -#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING 1 -#endif - #ifdef CGAL_INCLUDE_WINDOWS_DOT_H // Mimic users including this file which defines min max macros // and other names leading to name clashes @@ -147,8 +142,8 @@ #endif // Same for C++17 -#if __cplusplus >= 201703L || _MSVC_LANG >= 201703L -# define CGAL_CXX17 1 +#if !(__cplusplus >= 201703L || _MSVC_LANG >= 201703L) +#error "CGAL requires C++ 17" #endif // Same for C++20 #if __cplusplus >= 202002L || _MSVC_LANG >= 202002L @@ -491,12 +486,6 @@ namespace cpp11{ # define CGAL_FALLTHROUGH while(false){} #endif -#if CGAL_CXX17 -# define CGAL_CPP17_INLINE inline -#else -# define CGAL_CPP17_INLINE -#endif - #ifndef CGAL_NO_ASSERTIONS # define CGAL_NO_ASSERTIONS_BOOL false #else diff --git a/Installation/test/Installation/test_configuration_qt5.cpp b/Installation/test/Installation/test_configuration_qt5.cpp index af10e898b98..73206ca0b4f 100644 --- a/Installation/test/Installation/test_configuration_qt5.cpp +++ b/Installation/test/Installation/test_configuration_qt5.cpp @@ -13,7 +13,7 @@ template typename CGAL::Coercion_traits::Type binary_func(const A& a , const B& b){ typedef CGAL::Coercion_traits CT; - CGAL_static_assertion((CT::Are_explicit_interoperable::value)); + static_assert(CT::Are_explicit_interoperable::value); typename CT::Cast cast; return cast(a)*cast(b); } diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 9cc25059be9..67dc7512581 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -181,8 +181,8 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { // inline // typename Intersection_traits< typename Kernel_traits::Kernel, A, B>::result_type >::type // intersection(const A& a, const B& b) { -// CGAL_static_assertion_msg( (std::is_same::value), -// "intersection with objects of different dimensions not supported"); +// static_assert(std::is_same::value), +// "intersection with objects of different dimensions not supported"; // return internal::intersection_impl(a, b, typename A::Ambient_dimension()); // } @@ -190,7 +190,7 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { // inline // auto // K::Boolean // do_intersect(const A& a, const B& b) { -// CGAL_static_assertion_msg((std::is_same::value), +// static_assert(std::is_same::value, // "do_intersect with objects of different dimensions not supported"); // return internal::do_intersect_impl(a, b, typename A::Ambient_dimension()); // } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h index f7ebc70d25e..b62510e7892 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h @@ -66,7 +66,7 @@ class Do_intersect_bbox_segment_aux_is_greater double dmax; public: - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); Do_intersect_bbox_segment_aux_is_greater() : error(0.), tmax(0.), dmax(0.) {} diff --git a/Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h b/Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h index 11342ed5963..ba0ac8f14e7 100644 --- a/Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h +++ b/Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h @@ -41,7 +41,7 @@ void test_bigfloat_interval_traits() { typedef typename BFIT::Is_bigfloat_interval Is_bigfloat_interval; CGAL_USE_TYPE(Is_bigfloat_interval); // using CGAL::Tag_true; - CGAL_static_assertion(( ::std::is_same< Is_bigfloat_interval, CGAL::Tag_true>::value)); + static_assert(::std::is_same< Is_bigfloat_interval, CGAL::Tag_true>::value); const typename BFIT::Construct construct = typename BFIT::Construct(); const typename BFIT::Set_precision set_precision = typename BFIT::Set_precision(); diff --git a/Interval_support/include/CGAL/Test/_test_convert_to_bfi.h b/Interval_support/include/CGAL/Test/_test_convert_to_bfi.h index 34e731dae1a..8235c825644 100644 --- a/Interval_support/include/CGAL/Test/_test_convert_to_bfi.h +++ b/Interval_support/include/CGAL/Test/_test_convert_to_bfi.h @@ -41,7 +41,7 @@ template void test_convert_to_bfi_from(BFI,From){ typedef typename CGAL::Coercion_traits::Type CT_type; CGAL_USE_TYPE(CT_type); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); assert(CGAL::convert_to_bfi(From(0)) == BFI(0)); assert(CGAL::convert_to_bfi(From(1)) == BFI(1)); assert(CGAL::convert_to_bfi(From(2)) == BFI(2)); diff --git a/Interval_support/include/CGAL/Test/_test_interval_traits.h b/Interval_support/include/CGAL/Test/_test_interval_traits.h index d44384dff79..e90f8616ff2 100644 --- a/Interval_support/include/CGAL/Test/_test_interval_traits.h +++ b/Interval_support/include/CGAL/Test/_test_interval_traits.h @@ -36,7 +36,7 @@ void test_with_empty_interval(CGAL::Tag_false) { typedef CGAL::Interval_traits IT; typedef typename IT::Empty Empty; CGAL_USE_TYPE(Empty); - CGAL_static_assertion( + static_assert( (::std::is_same< Empty, CGAL::Null_functor>::value)); // this part changes in case we allow empty intersection @@ -74,8 +74,8 @@ void test_interval_traits() { typedef typename IT::With_empty_interval With_empty_interval; CGAL_USE_TYPE(Is_interval); using CGAL::Tag_true; - CGAL_static_assertion(( ::std::is_same< Is_interval, Tag_true>::value)); - CGAL_static_assertion(( ::std::is_same< Interval_, Interval>::value)); + static_assert(::std::is_same< Is_interval, Tag_true>::value); + static_assert(::std::is_same< Interval_, Interval>::value); test_with_empty_interval(With_empty_interval()); diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index 921a30d2206..b6020ff7528 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -35,7 +35,7 @@ class Circle_2 : public R_::Kernel_base::Circle_2 typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef Circle_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Circle_3.h b/Kernel_23/include/CGAL/Circle_3.h index 3030977c225..b23e651e9fc 100644 --- a/Kernel_23/include/CGAL/Circle_3.h +++ b/Kernel_23/include/CGAL/Circle_3.h @@ -43,7 +43,7 @@ template typedef typename R_::Direction_3 Direction_3; typedef Circle_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index e3478708354..407d4e31ed1 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -38,7 +38,7 @@ class Direction_2 : public R_::Kernel_base::Direction_2 typedef typename R_::Kernel_base::Direction_2 RDirection_2; typedef Direction_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Direction_3.h b/Kernel_23/include/CGAL/Direction_3.h index 6e0eb4930ab..18a88f7954d 100644 --- a/Kernel_23/include/CGAL/Direction_3.h +++ b/Kernel_23/include/CGAL/Direction_3.h @@ -37,7 +37,7 @@ class Direction_3 : public R_::Kernel_base::Direction_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Direction_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Has_conversion.h b/Kernel_23/include/CGAL/Has_conversion.h index 8e500c916d2..4e5d4603254 100644 --- a/Kernel_23/include/CGAL/Has_conversion.h +++ b/Kernel_23/include/CGAL/Has_conversion.h @@ -23,9 +23,9 @@ namespace internal { template struct Converter_selector { - CGAL_static_assertion_msg((std::is_same::value), - "Kernels must have the same representation"); + static_assert(std::is_same::value, + "Kernels must have the same representation"); typedef CGAL::Cartesian_converter type; }; @@ -33,9 +33,9 @@ struct Converter_selector template struct Converter_selector { - CGAL_static_assertion_msg((std::is_same::value), - "Kernels must have the same representation"); + static_assert(std::is_same::value, + "Kernels must have the same representation"); typedef CGAL::Homogeneous_converter type; }; diff --git a/Kernel_23/include/CGAL/Iso_cuboid_3.h b/Kernel_23/include/CGAL/Iso_cuboid_3.h index 057c6519ecd..d279426727f 100644 --- a/Kernel_23/include/CGAL/Iso_cuboid_3.h +++ b/Kernel_23/include/CGAL/Iso_cuboid_3.h @@ -35,7 +35,7 @@ class Iso_cuboid_3 : public R_::Kernel_base::Iso_cuboid_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Iso_cuboid_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Kernel_23/include/CGAL/Iso_rectangle_2.h index 1d27f73f4e2..7d3dc5a4709 100644 --- a/Kernel_23/include/CGAL/Iso_rectangle_2.h +++ b/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -33,7 +33,7 @@ class Iso_rectangle_2 : public R_::Kernel_base::Iso_rectangle_2 typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef Iso_rectangle_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index 3f757981eb2..33406d119a5 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -41,7 +41,7 @@ class Line_2 : public R_::Kernel_base::Line_2 typedef typename R_::Kernel_base::Line_2 RLine_2; typedef Line_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Line_3.h b/Kernel_23/include/CGAL/Line_3.h index 53f902c2104..ebfb32c7972 100644 --- a/Kernel_23/include/CGAL/Line_3.h +++ b/Kernel_23/include/CGAL/Line_3.h @@ -38,7 +38,7 @@ class Line_3 : public R_::Kernel_base::Line_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Line_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index 104191a5d64..b391b4388d2 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -41,7 +41,7 @@ class Plane_3 : public R_::Kernel_base::Plane_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Plane_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Point_2.h b/Kernel_23/include/CGAL/Point_2.h index 87728264781..96bffa243e2 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -37,7 +37,7 @@ class Point_2 : public R_::Kernel_base::Point_2 typedef typename R_::Kernel_base::Point_2 RPoint_2; typedef Point_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index 03d00f78f3f..f2444a9506c 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -34,7 +34,7 @@ class Point_3 : public R_::Kernel_base::Point_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Point_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Ray_2.h b/Kernel_23/include/CGAL/Ray_2.h index d9dae50482e..626730bbc86 100644 --- a/Kernel_23/include/CGAL/Ray_2.h +++ b/Kernel_23/include/CGAL/Ray_2.h @@ -42,7 +42,7 @@ class Ray_2 : public R_::Kernel_base::Ray_2 typedef typename R_::Kernel_base::Ray_2 RRay_2; typedef Ray_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index b35ae5e78a9..b415af7ad01 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -36,7 +36,7 @@ class Ray_3 : public R_::Kernel_base::Ray_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Ray_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index 6209c3a8139..d5d89246f3b 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -40,7 +40,7 @@ class Segment_2 : public R_::Kernel_base::Segment_2 typedef typename R_::Kernel_base::Segment_2 RSegment_2; typedef Segment_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index 7023f5fe3fe..61e02d657db 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -38,7 +38,7 @@ class Segment_3 : public R_::Kernel_base::Segment_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Segment_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 310303fed64..b0a7c271e24 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -37,7 +37,7 @@ class Sphere_3 : public R_::Kernel_base::Sphere_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Sphere_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Tetrahedron_3.h b/Kernel_23/include/CGAL/Tetrahedron_3.h index a8768746f58..549680d2554 100644 --- a/Kernel_23/include/CGAL/Tetrahedron_3.h +++ b/Kernel_23/include/CGAL/Tetrahedron_3.h @@ -33,7 +33,7 @@ class Tetrahedron_3 : public R_::Kernel_base::Tetrahedron_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Tetrahedron_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Triangle_2.h b/Kernel_23/include/CGAL/Triangle_2.h index cf35524a6a4..8deabe91f6e 100644 --- a/Kernel_23/include/CGAL/Triangle_2.h +++ b/Kernel_23/include/CGAL/Triangle_2.h @@ -35,7 +35,7 @@ class Triangle_2 : public R_::Kernel_base::Triangle_2 typedef typename R_::Kernel_base::Triangle_2 RTriangle_2; typedef Triangle_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Triangle_3.h b/Kernel_23/include/CGAL/Triangle_3.h index 92adba1fb86..19bbd8064ec 100644 --- a/Kernel_23/include/CGAL/Triangle_3.h +++ b/Kernel_23/include/CGAL/Triangle_3.h @@ -36,7 +36,7 @@ class Triangle_3 : public R_::Kernel_base::Triangle_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Triangle_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index 6e62f77fa5d..4449fc3ef9f 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -42,7 +42,7 @@ class Vector_2 : public R_::Kernel_base::Vector_2 typedef typename R_::Kernel_base::Vector_2 RVector_2; typedef Vector_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index f81aee480f4..9220f3e8527 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -42,7 +42,7 @@ class Vector_3 : public R_::Kernel_base::Vector_3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef Vector_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/include/CGAL/Weighted_point_2.h b/Kernel_23/include/CGAL/Weighted_point_2.h index ea4364644a8..32ca07df153 100644 --- a/Kernel_23/include/CGAL/Weighted_point_2.h +++ b/Kernel_23/include/CGAL/Weighted_point_2.h @@ -34,7 +34,7 @@ class Weighted_point_2 : public R_::Kernel_base::Weighted_point_2 typedef typename R_::FT RT; typedef Weighted_point_2 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: typedef Dimension_tag<2> Ambient_dimension; diff --git a/Kernel_23/include/CGAL/Weighted_point_3.h b/Kernel_23/include/CGAL/Weighted_point_3.h index c57467fb17a..28e8f9489a5 100644 --- a/Kernel_23/include/CGAL/Weighted_point_3.h +++ b/Kernel_23/include/CGAL/Weighted_point_3.h @@ -34,7 +34,7 @@ class Weighted_point_3 : public R_::Kernel_base::Weighted_point_3 typedef typename R_::FT FT; typedef Weighted_point_3 Self; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); public: diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_2.h index 4473d4c55e3..27141b2fb6d 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_2.h @@ -58,10 +58,10 @@ _test_cls_point_2(const R& ) CGAL::Weighted_point_2 wp(p1); CGAL::Point_2 p7(wp); - CGAL_static_assertion(!(std::is_convertible, - CGAL::Point_2 >::value)); - CGAL_static_assertion(!(std::is_convertible, - CGAL::Weighted_point_2 >::value)); + static_assert(!std::is_convertible, + CGAL::Point_2 >::value); + static_assert(!std::is_convertible, + CGAL::Weighted_point_2 >::value); std::cout << '.'; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_3.h index 29471b3c10d..b2e003eedfe 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_point_3.h @@ -58,10 +58,10 @@ _test_cls_point_3(const R& ) CGAL::Weighted_point_3 wp(p1); CGAL::Point_3 p7(wp); - CGAL_static_assertion(!(std::is_convertible, - CGAL::Point_3 >::value)); - CGAL_static_assertion(!(std::is_convertible, - CGAL::Weighted_point_3 >::value)); + static_assert(!std::is_convertible, + CGAL::Point_3 >::value); + static_assert(!std::is_convertible, + CGAL::Weighted_point_3 >::value); std::cout << '.'; diff --git a/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp b/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp index 03b2787cc0b..b0771f329ca 100644 --- a/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp +++ b/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp @@ -229,12 +229,12 @@ void generate_atomic_compilation_test(const std::string& FT_name, if(check != NO_CHECK) { - out << " static_assert((std::is_same::value));\n"; diff --git a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h index e43fb279038..525c35eaec7 100644 --- a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h +++ b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h @@ -74,7 +74,7 @@ namespace CGAL { typedef typename Dart_container::size_type size_type; typedef std::nullptr_t Null_descriptor_type; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_descriptor=nullptr; + inline static constexpr Null_descriptor_type null_descriptor=nullptr; using Type_for_compact_container=void*; @@ -128,7 +128,7 @@ namespace CGAL { using Vertex_attribute_handle=Vertex_attribute_descriptor; using Vertex_attribute_const_handle=Vertex_attribute_const_descriptor; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_handle=null_descriptor; + inline static constexpr Null_descriptor_type null_handle=null_descriptor; /// Number of marks static const size_type NB_MARKS = 32; @@ -253,7 +253,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -262,7 +262,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -273,7 +273,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); typename Attribute_descriptor::type res= std::get::value> @@ -502,17 +502,6 @@ namespace CGAL { typename Helper::Attribute_containers mattribute_containers; }; -#ifndef CGAL_CXX17 - template - constexpr typename CMap_linear_cell_complex_storage_1::Null_descriptor_type - CMap_linear_cell_complex_storage_1::null_descriptor; - - template - constexpr typename CMap_linear_cell_complex_storage_1::Null_descriptor_type - CMap_linear_cell_complex_storage_1::null_handle; -#endif } // namespace CGAL #if defined(BOOST_GCC) 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 8417e20b226..56010ad433a 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 @@ -287,7 +287,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -296,7 +296,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -307,7 +307,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); // We need to do a reserve before the emplace in order to avoid a bug of // invalid reference when the container is reallocated. diff --git a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h index 3b90e193fa2..2d4b0f67537 100644 --- a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h +++ b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h @@ -74,7 +74,7 @@ namespace CGAL { typedef typename Dart_container::size_type size_type; typedef std::nullptr_t Null_descriptor_type; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_descriptor=nullptr; + inline static constexpr Null_descriptor_type null_descriptor=nullptr; using Type_for_compact_container=void*; @@ -128,7 +128,7 @@ namespace CGAL { using Vertex_attribute_handle=Vertex_attribute_descriptor; using Vertex_attribute_const_handle=Vertex_attribute_const_descriptor; - CGAL_CPP17_INLINE static constexpr Null_descriptor_type null_handle=null_descriptor; + inline static constexpr Null_descriptor_type null_handle=null_descriptor; /// Number of marks static const size_type NB_MARKS = 32; @@ -250,7 +250,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -259,7 +259,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (ADart->mattribute_descriptors); @@ -270,7 +270,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); typename Attribute_descriptor::type res= std::get::value> @@ -493,18 +493,6 @@ namespace CGAL { typename Helper::Attribute_containers mattribute_containers; }; -#ifndef CGAL_CXX17 - template - constexpr typename GMap_linear_cell_complex_storage_1::Null_descriptor_type - GMap_linear_cell_complex_storage_1::null_descriptor; - - template - constexpr typename GMap_linear_cell_complex_storage_1::Null_descriptor_type - GMap_linear_cell_complex_storage_1::null_handle; -#endif - } // namespace CGAL #if defined(BOOST_GCC) diff --git a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages_with_index.h b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages_with_index.h index 27d58a7651a..5d260bee1ec 100644 --- a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages_with_index.h +++ b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages_with_index.h @@ -239,7 +239,7 @@ namespace CGAL { template typename Attribute_descriptor::type attribute(Dart_descriptor ADart) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -248,7 +248,7 @@ namespace CGAL { typename Attribute_const_descriptor::type attribute(Dart_const_descriptor ADart) const { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); return std::get::value> (mdarts[ADart].mattribute_descriptors); @@ -259,7 +259,7 @@ namespace CGAL { typename Attribute_descriptor::type copy_attribute (typename Attribute_const_descriptor::type ah) { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + static_assert(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); // We need to do a reserve before the emplace in order to avoid a bug of // invalid reference when the container is reallocated. diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h index 4569404479d..4669765f493 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h @@ -775,7 +775,7 @@ namespace CGAL { Dart_descriptor insert_point_in_cell(Dart_descriptor dh, const Point& p, bool update_attributes=true) { - CGAL_static_assertion(1<=i && i<=2); + static_assert(1<=i && i<=2); if (i==1) return insert_point_in_cell_1(dh, p, update_attributes); return insert_point_in_cell_2(dh, p, update_attributes); } diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 1bdac283a67..e770c67e86c 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -48,7 +48,7 @@ namespace CGAL { typedef typename std::list::iterator List_iterator; typedef typename LCC::Point Point; - CGAL_static_assertion( LCC::dimension>=2 && LCC::ambient_dimension==2 ); + static_assert( LCC::dimension>=2 && LCC::ambient_dimension==2 ); CGAL_assertion(edge_indices.size() % 2 == 0); std::vector< typename LCC::Vertex_attribute_descriptor > initVertices; diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h index 4728c9bf2f3..a895b915b78 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h @@ -120,7 +120,7 @@ namespace CGAL { static typename LCC::Point run(const LCC& amap, typename LCC::Dart_const_descriptor adart) { - CGAL_static_assertion(0| done diff --git a/Matrix_search/include/CGAL/Cartesian_matrix.h b/Matrix_search/include/CGAL/Cartesian_matrix.h index 1aa192ab2c8..be3dba778b4 100644 --- a/Matrix_search/include/CGAL/Cartesian_matrix.h +++ b/Matrix_search/include/CGAL/Cartesian_matrix.h @@ -28,11 +28,7 @@ template < class Operation, class Cartesian_matrix { public: -#if CGAL_CXX17 && __has_cpp_attribute(nodiscard) typedef typename std::invoke_result::value_type, typename std::iterator_traits::value_type>::type Value; -#else - typedef typename Operation::result_type Value; -#endif Cartesian_matrix(RandomAccessIC_row r_f, RandomAccessIC_row r_l, diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index c66d416841c..d30acbcb141 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -485,8 +485,8 @@ public: template const Point_3& weighted_circumcenter(const GT_& gt) const { - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); if (internal_tbb::is_null(weighted_circumcenter_)) { this->try_to_set_circumcenter( new Point_3(gt.construct_weighted_circumcenter_3_object() diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index b20a713291e..fa30efc12ca 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -1569,17 +1569,10 @@ private: Cell_vector c3t3_cells(const Cell_vector& cells) const { Cell_vector c3t3_cells; -#ifdef CGAL_CXX17 std::remove_copy_if(cells.begin(), cells.end(), std::back_inserter(c3t3_cells), std::not_fn(Is_in_c3t3(c3t3_))); -#else - std::remove_copy_if(cells.begin(), - cells.end(), - std::back_inserter(c3t3_cells), - std::not1(Is_in_c3t3(c3t3_)) ); -#endif return c3t3_cells; } @@ -3660,17 +3653,10 @@ incident_slivers(const Vertex_handle& v, std::vector incident_cells_; tr_.incident_cells(v, std::back_inserter(incident_cells_)); -#ifdef CGAL_CXX17 std::remove_copy_if(incident_cells_.begin(), incident_cells_.end(), out, std::not_fn(Is_sliver(c3t3_, criterion, sliver_bound))); -#else - std::remove_copy_if(incident_cells_.begin(), - incident_cells_.end(), - out, - std::not1(Is_sliver(c3t3_,criterion,sliver_bound))); -#endif return out; } diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 805bc4434c9..a6220203a64 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -101,19 +101,19 @@ public: template void add_facet_criterion(Facet_criterion* criterion) { - CGAL_static_assertion((std::is_base_of< + static_assert(std::is_base_of< typename Facet_criteria::Abstract_criterion, Facet_criterion - >::value)); + >::value); facet_criteria_.add(criterion); } template void add_cell_criterion(Cell_criterion* criterion) { - CGAL_static_assertion((std::is_base_of< + static_assert(std::is_base_of< typename Cell_criteria::Abstract_criterion, Cell_criterion - >::value)); + >::value); cell_criteria_.add(criterion); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 091611ddfb8..379e1e5453d 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -69,7 +69,7 @@ public: this->verify(c3t3,domain,criteria, Bissection_tag()); typedef typename Mesh_domain::Surface_patch_index Patch_id; - CGAL_static_assertion(CGAL::Output_rep::is_specialized); + static_assert(CGAL::Output_rep::is_specialized); CGAL_USE_TYPE(Patch_id); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp index 8107c4cefb5..2883524ccc8 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp @@ -51,7 +51,7 @@ public: this->verify(c3t3,domain,criteria, Bissection_tag()); typedef typename Mesh_domain::Surface_patch_index Patch_id; - CGAL_static_assertion(CGAL::Output_rep::is_specialized); + static_assert(CGAL::Output_rep::is_specialized); CGAL_USE_TYPE(Patch_id); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_with_features.cpp index 1c9607d45cc..15682e0429b 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_with_features.cpp @@ -85,7 +85,7 @@ struct Image_tester : public Tester this->verify(c3t3, domain, criteria, Bissection_tag()); typedef typename Mesh_domain::Surface_patch_index Patch_id; - CGAL_static_assertion(CGAL::Output_rep::is_specialized); + static_assert(CGAL::Output_rep::is_specialized); CGAL_USE_TYPE(Patch_id); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index c5a30ccb1ec..09021df2d4c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -35,10 +35,10 @@ struct Polyhedron_tester : public Tester typedef CGAL::Polyhedron_3 Polyhedron; typedef CGAL::Polyhedral_mesh_domain_3 Mesh_domain; - CGAL_static_assertion((std::is_same< + static_assert(std::is_same< typename Mesh_domain::Surface_patch_index, std::pair - >::value)); + >::value); typedef typename CGAL::Mesh_triangulation_3< Mesh_domain, diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index a28160ed477..a1aced0e3ff 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -959,7 +959,7 @@ bool is_forward_edge(const Const_decorator& N, void assert_type_precondition() const { typename PM_decorator_::Point p1; Point p2; - CGAL_static_assertion((std::is_same::value)); } + static_assert(std::is_same::value); } diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h b/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h index 50ac9fbedf8..31f86c5c43a 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Kernel_d_interface.h @@ -135,8 +135,8 @@ template struct Kernel_d_interface : public Base_ { typedef typename Base::Point_cartesian_const_iterator result_type; // Kernel_d requires a common iterator type for points and vectors // TODO: provide this mixed functor in preKernel? - // CGAL_static_assertion((std::is_same::type>::type, result_type>::value)); - // CGAL_static_assertion((std::is_same::type, result_type>::value)); + // static_assert(std::is_same::type>::type, result_type>::value); + // static_assert(std::is_same::type, result_type>::value); template auto operator()(Point_d const&p, Tag_ t)const{ return CPI(this->kernel())(p,t); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h b/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h index 0ac98f7261b..2c69eec6da6 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Vector/array.h @@ -41,7 +41,7 @@ template struct Array_vector { template struct Property : std::false_type {}; static const unsigned d_=Max_dim_::value; - CGAL_static_assertion(d_ != (unsigned)UNKNOWN_DIMENSION); + static_assert(d_ != (unsigned)UNKNOWN_DIMENSION); typedef std::array Vector; struct Construct_vector { diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h index 2eae60f5576..4efc63d87a6 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h @@ -32,7 +32,7 @@ class Hyperplane_d : public Get_type:: typedef typename Get_functor::type HTBase; typedef Hyperplane_d Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index 42d94a93c73..af2d970f3f2 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -40,7 +40,7 @@ class Point_d : public Get_type::type typedef Point_d Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h index fefbca812b7..097a41f9755 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h @@ -33,7 +33,7 @@ class Ref_count_obj typedef typename Get_functor >::type CBase; typedef Ref_count_obj Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: typedef R_ R; diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Segment_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Segment_d.h index 28bd4e8a8a3..c450300b587 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Segment_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Segment_d.h @@ -35,7 +35,7 @@ class Segment_d : public Get_type::type typedef typename Get_functor::type CSEBase; typedef Segment_d Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Sphere_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Sphere_d.h index 7bcd8568dcc..611217e9acd 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Sphere_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Sphere_d.h @@ -32,7 +32,7 @@ class Sphere_d : public Get_type::type typedef typename Get_functor::type SRBase; typedef Sphere_d Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h index 6d47e86d2f3..1b150be0aae 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h @@ -39,7 +39,7 @@ class Vector_d : public Get_type::type typedef typename Get_functor::type SLBase; typedef Vector_d Self; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); public: diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp index bbc3b6a128c..18ac1657ee6 100644 --- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp +++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp @@ -740,11 +740,11 @@ template struct CGAL::Epick_d; typedef CGAL::Epick_d > Ker2; typedef CGAL::Epick_d > Ker3; typedef CGAL::Epick_d Kerd; -CGAL_static_assertion((std::is_same,Ker2::Dimension>::value)); -CGAL_static_assertion((std::is_same,Ker3::Dimension>::value)); -CGAL_static_assertion((std::is_same::value)); -CGAL_static_assertion((std::is_same,CGAL::Ambient_dimension::type>::value)); -CGAL_static_assertion((std::is_same,CGAL::Ambient_dimension::type>::value)); +static_assert(std::is_same,Ker2::Dimension>::value); +static_assert(std::is_same,Ker3::Dimension>::value); +static_assert(std::is_same::value); +static_assert(std::is_same,CGAL::Ambient_dimension::type>::value); +static_assert(std::is_same,CGAL::Ambient_dimension::type>::value); int main(){ //Broken with Linear_base_d (output iterator) //test2 >(); diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index 6890fc17420..17366e72157 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -943,9 +943,9 @@ struct Div_mod_selector { void operator()( const NT1& x, const NT2& y, NT& q, NT& r ) const { - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< typename Coercion_traits< NT1, NT2 >::Type, NT - >::value)); + >::value); typename Coercion_traits< NT1, NT2 >::Cast cast; operator()( cast(x), cast(y), q, r ); @@ -1028,8 +1028,8 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > : public INTERN_RET::Real_embeddable_traits_base< Lazy_exact_nt , CGAL::Tag_true > { // Every type ET of Lazy_exact_nt has to be real embeddable. - CGAL_static_assertion((::std::is_same< typename Real_embeddable_traits< ET > - ::Is_real_embeddable, Tag_true >::value)); + static_assert(::std::is_same< typename Real_embeddable_traits< ET > + ::Is_real_embeddable, Tag_true >::value); public: typedef Lazy_exact_nt Type; diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 93cfcd5b30c..020ea8ce94b 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -148,7 +148,7 @@ template struct pool2 { static bool empty() { return data() == 0; } static const int extra = 1; // TODO: handle the case where a pointer is larger than a mp_limb_t private: - CGAL_static_assertion(sizeof(T) >= sizeof(T*)); + static_assert(sizeof(T) >= sizeof(T*)); static T& data () { static CGAL_MPZF_TLS T data_ = 0; return data_; @@ -162,7 +162,7 @@ template struct pool3 { static bool empty() { return data() == 0; } static const int extra = 1; // TODO: handle the case where a pointer is larger than a mp_limb_t private: - CGAL_static_assertion(sizeof(T) >= sizeof(T*)); + static_assert(sizeof(T) >= sizeof(T*)); struct cleaner { T data_ = 0; ~cleaner(){ @@ -455,7 +455,7 @@ struct Mpzf { } int e1 = (int)dexp+13; // FIXME: make it more general! But not slower... - CGAL_static_assertion(GMP_NUMB_BITS == 64); + static_assert(GMP_NUMB_BITS == 64); int e2 = e1 % 64; exp = e1 / 64 - 17; // 52+1023+13==17*64 ? diff --git a/Number_types/include/CGAL/Root_of_traits.h b/Number_types/include/CGAL/Root_of_traits.h index a1a941277bc..32d81e481a9 100644 --- a/Number_types/include/CGAL/Root_of_traits.h +++ b/Number_types/include/CGAL/Root_of_traits.h @@ -150,7 +150,7 @@ private: // We have the typedef as VC10 fails with // static_assert(FrT::Is_fraction::value) typedef typename FrT::Is_fraction ISF; - CGAL_static_assertion((ISF::value)); + static_assert(ISF::value); typedef typename FrT::Numerator_type RT; diff --git a/Number_types/include/CGAL/Test/test_root_of_traits.h b/Number_types/include/CGAL/Test/test_root_of_traits.h index ae1c7768852..58c1340335f 100644 --- a/Number_types/include/CGAL/Test/test_root_of_traits.h +++ b/Number_types/include/CGAL/Test/test_root_of_traits.h @@ -28,8 +28,8 @@ void test_root_of_traits(){ typedef typename RoT::Root_of_1 Root_of_1; typedef typename RoT::Root_of_2 Root_of_2; - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); typedef typename RoT::Make_root_of_2 Make_root_of_2; typedef typename RoT::Make_sqrt Make_sqrt; @@ -41,10 +41,10 @@ void test_root_of_traits(){ const Inverse& inverse = Inverse(); const Square& square = Square(); - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); { diff --git a/Number_types/include/CGAL/mpq_class.h b/Number_types/include/CGAL/mpq_class.h index a651b674202..7348097644e 100644 --- a/Number_types/include/CGAL/mpq_class.h +++ b/Number_types/include/CGAL/mpq_class.h @@ -35,7 +35,7 @@ // while ::__gmp_expr is the others "expressions". #define CGAL_CHECK_GMP_EXPR_MPQ_CLASS \ - CGAL_static_assertion( \ + static_assert( \ (::std::is_same< ::__gmp_expr< T , T >,Type>::value )); namespace CGAL { diff --git a/Number_types/include/CGAL/mpz_class.h b/Number_types/include/CGAL/mpz_class.h index 9b868199f9f..c8899fc1b97 100644 --- a/Number_types/include/CGAL/mpz_class.h +++ b/Number_types/include/CGAL/mpz_class.h @@ -38,7 +38,7 @@ #include #define CGAL_CHECK_GMP_EXPR \ - CGAL_static_assertion( \ + static_assert( \ (::std::is_same< ::__gmp_expr< T , T >,Type>::value )); namespace CGAL { diff --git a/Number_types/include/CGAL/simplest_rational_in_interval.h b/Number_types/include/CGAL/simplest_rational_in_interval.h index 374d89e1fd2..fbb5206ffbe 100644 --- a/Number_types/include/CGAL/simplest_rational_in_interval.h +++ b/Number_types/include/CGAL/simplest_rational_in_interval.h @@ -43,10 +43,10 @@ simplest_rational_in_interval(double x, double y) { // Must be a fraction CGAL_USE_TYPE(Is_fraction); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); // Numerator_type,Denominator_type must be the same CGAL_USE_TYPE(Denominator_type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); if(x == y){ diff --git a/Number_types/include/CGAL/to_rational.h b/Number_types/include/CGAL/to_rational.h index add67aeb6cc..3ce75dd8032 100644 --- a/Number_types/include/CGAL/to_rational.h +++ b/Number_types/include/CGAL/to_rational.h @@ -34,9 +34,9 @@ to_rational(double x) typedef typename FT::Denominator_type Denominator_type; typename FT::Compose compose; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); CGAL_USE_TYPE(Is_fraction); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); CGAL_USE_TYPE(Denominator_type); Numerator_type num(0),den(1); diff --git a/Number_types/test/Number_types/Lazy_exact_nt_new.cpp b/Number_types/test/Number_types/Lazy_exact_nt_new.cpp index 54a1ea8581e..fffb0108143 100644 --- a/Number_types/test/Number_types/Lazy_exact_nt_new.cpp +++ b/Number_types/test/Number_types/Lazy_exact_nt_new.cpp @@ -81,9 +81,9 @@ void test_lazy_exact_nt() { typedef CGAL::Lazy_exact_nt< typename AK::Integer > LI; typedef CGAL::Lazy_exact_nt< typename AK::Rational > LR; typedef CGAL::Coercion_traits CT; - CGAL_static_assertion((std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value)); - CGAL_static_assertion((std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value)); - CGAL_static_assertion((std::is_same< typename CT::Type,LR>::value)); + static_assert(std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value); + static_assert(std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value); + static_assert(std::is_same< typename CT::Type,LR>::value); LI i(4); LR r(4); @@ -99,8 +99,8 @@ void test_lazy_exact_nt() { typedef CGAL::Lazy_exact_nt T1; typedef CGAL::Lazy_exact_nt T2; typedef CGAL::Coercion_traits CT; - CGAL_static_assertion((std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_false>::value)); - CGAL_static_assertion((std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value)); + static_assert(std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_false>::value); + static_assert(std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value); #endif #endif } diff --git a/Number_types/test/Number_types/Quotient_new.cpp b/Number_types/test/Number_types/Quotient_new.cpp index 65450205e87..dfa2c37da05 100644 --- a/Number_types/test/Number_types/Quotient_new.cpp +++ b/Number_types/test/Number_types/Quotient_new.cpp @@ -62,9 +62,9 @@ void test_quotient() { typedef CGAL::Quotient QI; typedef CGAL::Coercion_traits CT; CGAL_USE_TYPE(CT); - CGAL_static_assertion((std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value)); - CGAL_static_assertion((std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value)); - CGAL_static_assertion((std::is_same< typename CT::Type,QI>::value)); + static_assert(std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value); + static_assert(std::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value); + static_assert(std::is_same< typename CT::Type,QI>::value); } } diff --git a/Number_types/test/Number_types/Sqrt_extension.h b/Number_types/test/Number_types/Sqrt_extension.h index b2c8f42d47d..825ba19d252 100644 --- a/Number_types/test/Number_types/Sqrt_extension.h +++ b/Number_types/test/Number_types/Sqrt_extension.h @@ -24,7 +24,7 @@ void convert_to(const NT& x, RT& r){ typedef CGAL::Coercion_traits CT; typedef typename CT::Type Type; CGAL_USE_TYPE(Type); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); r = typename CT::Cast()(x); } } //namespace CGAL @@ -700,17 +700,17 @@ void test_get_arithmetic_kernel(){ typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; CGAL_USE_TYPE(AT_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } { typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; CGAL_USE_TYPE(AT_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } { typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; CGAL_USE_TYPE(AT_); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } } diff --git a/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h b/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h index bb979e588f3..2ffb9133345 100644 --- a/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h +++ b/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h @@ -7,12 +7,12 @@ void test_root_of_traits(){ typedef typename RoT::Root_of_1 Root_of_1; typedef typename RoT::Root_of_2 Root_of_2; - CGAL_static_assertion((::std::is_same::value)); - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); + static_assert(::std::is_same::value); typedef typename RoT::Make_root_of_2 Make_root_of_2; typedef typename Make_root_of_2::result_type result_type; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); const Make_root_of_2& make_root_of_2 = Make_root_of_2(); Root_of_2 r = make_root_of_2(T(0),T(-1),T(2)); //-sqrt(2) diff --git a/Number_types/test/Number_types/ioformat.cpp b/Number_types/test/Number_types/ioformat.cpp index 4d9a6656321..54eaa26bf22 100644 --- a/Number_types/test/Number_types/ioformat.cpp +++ b/Number_types/test/Number_types/ioformat.cpp @@ -106,7 +106,7 @@ int main() // CORE #ifdef CGAL_USE_CORE - CGAL_static_assertion(CGAL::Output_rep::is_specialized == true); + static_assert(CGAL::Output_rep::is_specialized == true); //bug in io for CORE. test_it("CORE::BigInt"); test_it("CORE::BigRat"); @@ -116,7 +116,7 @@ int main() // LEDA based NTs #ifdef CGAL_USE_LEDA - CGAL_static_assertion(CGAL::Output_rep::is_specialized == true); + static_assert(CGAL::Output_rep::is_specialized == true); test_it("leda_integer"); test_it("leda_rational"); test_it("leda_bigfloat"); diff --git a/Number_types/test/Number_types/known_bit_size_integers.cpp b/Number_types/test/Number_types/known_bit_size_integers.cpp index 93f2be8d6ec..351ffa412af 100644 --- a/Number_types/test/Number_types/known_bit_size_integers.cpp +++ b/Number_types/test/Number_types/known_bit_size_integers.cpp @@ -7,19 +7,16 @@ int main() std::cout << "Verifying the sizes of boost::[u]int{8,16,32,64}_t" << std::endl; - CGAL_static_assertion(sizeof(std::int8_t) == 1); - CGAL_static_assertion(sizeof(std::int16_t) == 2); - CGAL_static_assertion(sizeof(std::int32_t) == 4); -#ifndef BOOST_NO_INT64_T - CGAL_static_assertion(sizeof(std::int64_t) == 8); -#endif + static_assert(sizeof(std::int8_t) == 1); + static_assert(sizeof(std::int16_t) == 2); + static_assert(sizeof(std::int32_t) == 4); + static_assert(sizeof(std::int64_t) == 8); - CGAL_static_assertion(sizeof(std::uint8_t) == 1); - CGAL_static_assertion(sizeof(std::uint16_t) == 2); - CGAL_static_assertion(sizeof(std::uint32_t) == 4); -#ifndef BOOST_NO_INT64_T - CGAL_static_assertion(sizeof(std::uint64_t) == 8); -#endif + + static_assert(sizeof(std::uint8_t) == 1); + static_assert(sizeof(std::uint16_t) == 2); + static_assert(sizeof(std::uint32_t) == 4); + static_assert(sizeof(std::uint64_t) == 8); return 0; } diff --git a/Number_types/test/Number_types/test_nt_Coercion_traits.cpp b/Number_types/test/Number_types/test_nt_Coercion_traits.cpp index ad73c7555c6..bb7d28b3eab 100644 --- a/Number_types/test/Number_types/test_nt_Coercion_traits.cpp +++ b/Number_types/test/Number_types/test_nt_Coercion_traits.cpp @@ -144,9 +144,9 @@ void AT_coercion_test_for_cgal_types_rat(){ typedef typename AT::Bigfloat_interval Bigfloat_interval; CGAL_USE_TYPE(Bigfloat_interval); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); CGAL::test_explicit_interoperable_from_to(); CGAL::test_explicit_interoperable_from_to(); @@ -205,10 +205,10 @@ void AT_coercion_test_for_cgal_types_fws(){ typedef typename AT::Field_with_sqrt Real; CGAL_USE_TYPE(Bigfloat_interval); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); - CGAL_static_assertion(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); + static_assert(!(::std::is_same::value)); typedef CGAL::Sqrt_extension Extn_1; 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 4ff08af8d1d..ae450d781e8 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 @@ -119,7 +119,7 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot, typedef typename Traits::Matrix Matrix; typedef typename Traits::Vector Vector; - CGAL_static_assertion((std::is_same::type, Point>::value)); + static_assert(std::is_same::type, Point>::value); std::vector rotated_points; rotated_points.reserve(points.size()); diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h index 61cabd171f8..d64b73e699b 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h @@ -202,7 +202,7 @@ void construct_oriented_bounding_box(const PointRange& points, { typedef typename Traits::Point_3 Point; - CGAL_static_assertion((std::is_same::type, Point>::value)); + static_assert(std::is_same::type, Point>::value); if(use_ch) // construct the convex hull to reduce the number of points { @@ -341,7 +341,7 @@ void oriented_bounding_box(const PointRange& points, NamedParameters, Default_traits>::type Geom_traits; - CGAL_static_assertion_msg(!(std::is_same::value), + static_assert(!(std::is_same::value), "You must provide a traits class or have Eigen enabled!"); Geom_traits traits = choose_parameter(get_parameter(np, internal_np::geom_traits)); diff --git a/Point_set_processing_3/include/CGAL/OpenGR/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/OpenGR/compute_registration_transformation.h index dcda82d9555..229ceab85ff 100644 --- a/Point_set_processing_3/include/CGAL/OpenGR/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/OpenGR/compute_registration_transformation.h @@ -309,14 +309,14 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point typedef Point_set_processing_3_np_helper NP_helper2; typedef typename NP_helper1::Const_point_map PointMap1; typedef typename NP_helper2::Const_point_map PointMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The point type of input ranges must be the same"); typedef typename NP_helper1::Normal_map NormalMap1; typedef typename NP_helper2::Normal_map NormalMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The vector type of input ranges must be the same"); typedef typename NP_helper1::Geom_traits Kernel; diff --git a/Point_set_processing_3/include/CGAL/OpenGR/register_point_sets.h b/Point_set_processing_3/include/CGAL/OpenGR/register_point_sets.h index 5e5d7853bee..5f45ba40acb 100644 --- a/Point_set_processing_3/include/CGAL/OpenGR/register_point_sets.h +++ b/Point_set_processing_3/include/CGAL/OpenGR/register_point_sets.h @@ -222,14 +222,14 @@ register_point_sets (const PointRange1& point_set_1, PointRange2& point_set_2, typedef Point_set_processing_3_np_helper NP_helper2; typedef typename NP_helper1::Const_point_map PointMap1; typedef typename NP_helper2::Const_point_map PointMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The point type of input ranges must be the same"); typedef typename NP_helper1::Normal_map NormalMap1; typedef typename NP_helper2::Normal_map NormalMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The vector type of input ranges must be the same"); typedef typename NP_helper1::Geom_traits Kernel; diff --git a/Point_set_processing_3/include/CGAL/cluster_point_set.h b/Point_set_processing_3/include/CGAL/cluster_point_set.h index c79cd850df1..6381c456917 100644 --- a/Point_set_processing_3/include/CGAL/cluster_point_set.h +++ b/Point_set_processing_3/include/CGAL/cluster_point_set.h @@ -145,7 +145,7 @@ std::size_t cluster_point_set (PointRange& points, typedef typename NP_helper::Geom_traits Kernel; typedef typename Point_set_processing_3::GetAdjacencies::type Adjacencies; - CGAL_static_assertion_msg(!(std::is_same::type, + static_assert(!(std::is_same::type, typename GetSvdTraits::NoTraits>::value), "Error: no SVD traits"); diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index d808a6ee46f..1465fc7e357 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -197,7 +197,7 @@ jet_estimate_normals( typedef typename GetSvdTraits::type SvdTraits; CGAL_assertion_msg(NP_helper::has_normal_map(points, np), "Error: no normal map"); - CGAL_static_assertion_msg(!(std::is_same::NoTraits>::value), "Error: no SVD traits"); diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index c8982be7517..952f2c0d595 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -200,7 +200,7 @@ jet_smooth_point_set( typedef typename NP_helper::Geom_traits Kernel; typedef typename GetSvdTraits::type SvdTraits; - CGAL_static_assertion_msg(!(std::is_same::NoTraits>::value), "Error: no SVD traits"); diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index e8dac2ddc2b..6130aadaaf1 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -607,14 +607,14 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point // property map types typedef typename NP_helper1::Const_point_map PointMap1; typedef typename NP_helper2::Const_point_map PointMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The point type of input ranges must be the same"); typedef typename NP_helper1::Normal_map NormalMap1; typedef typename NP_helper2::Normal_map NormalMap2; - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The vector type of input ranges must be the same"); typedef typename std::iterator_traits::value_type key_type1; @@ -630,8 +630,8 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point NormalMap2 normal_map2 = NP_helper2::get_normal_map(point_set_2, np2); auto weight_map2 = choose_parameter(get_parameter(np2, internal_np::scalar_map), DefaultWeightMap2(Scalar(1))); - CGAL_static_assertion_msg((std::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), + static_assert(std::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value, "The scalar type of input ranges must be the same"); // initial transformation diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 043001e3b04..0b517436394 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -234,7 +234,7 @@ public: typedef typename Point_set_processing_3::GetPlaneIndexMap::type PlaneIndexMap; CGAL_assertion_msg(NP_helper::has_normal_map(points, np), "Error: no normal map"); - CGAL_static_assertion_msg((!is_default_parameter::value), + static_assert(!is_default_parameter::value, "Error: no plane index map"); PointMap point_map = NP_helper::get_const_point_map(points, np); diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index 41412051408..149944d50a2 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -525,6 +525,7 @@ wlop_simplify_and_regularize_point_set( if (require_uniform_sampling)//default value is false { + original_density_weights.reserve(number_of_original); //todo: this part could also be parallelized if needed for (it = first_original_iter, i = 0; it != points.end() ; ++it, ++i) { @@ -552,6 +553,7 @@ wlop_simplify_and_regularize_point_set( // Compute sample density weight for sample points std::vector sample_density_weights; + sample_density_weights.reserve(number_of_sample); for (sample_iter = sample_points.begin(); sample_iter != sample_points.end(); ++sample_iter) @@ -602,9 +604,7 @@ wlop_simplify_and_regularize_point_set( if (interrupted) return output; - sample_iter = sample_points.begin(); - for (std::size_t i = 0; i < sample_points.size(); ++ i) - sample_points[i] = update_sample_points[i]; + sample_points.swap(update_sample_points); } // final output diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index d40ae739691..f37105cd6e6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -444,8 +444,8 @@ generic_clip_impl( typedef typename GetVertexPointMap::type Vpm2; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); Vpm vpm1 = choose_parameter(get_parameter(np1, internal_np::vertex_point), get_property_map(boost::vertex_point, tm1)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 525f020a342..bffa8e6dca1 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -553,7 +553,7 @@ std::size_t keep_large_connected_components(PolygonMesh& pmesh, >::type FaceSizeMap; typedef typename boost::property_traits::value_type Face_size; - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); typedef typename internal_np::Lookup_named_param_def::type VPM1; typedef typename GetVertexPointMap::type VPM2; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); VPM1 vpm1 = choose_parameter(get_parameter(np1, internal_np::vertex_point), get_property_map(boost::vertex_point, tm1)); @@ -694,8 +694,8 @@ corefine( TriangleMesh& tm1, typedef typename GetVertexPointMap::type VPM1; typedef typename GetVertexPointMap::type VPM2; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); VPM1 vpm1 = choose_parameter(get_parameter(np1, internal_np::vertex_point), get_property_map(boost::vertex_point, tm1)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index 180d40f892f..85c78461d73 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -155,7 +155,7 @@ double max_distance_to_mesh_impl(const PointRange& sample_points, using FT = typename Kernel::FT; #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if(std::is_convertible::value) @@ -1037,7 +1037,7 @@ sample_triangle_soup(const PointRange& points, typedef typename PointRange::value_type Point_3; typedef typename Kernel_traits::Kernel GeomTraits; - CGAL_static_assertion_msg((std::is_same::value), "Wrong point type."); + static_assert(std::is_same::value, "Wrong point type."); CGAL_precondition(!triangles.empty()); @@ -1995,8 +1995,8 @@ bounded_error_squared_one_sided_Hausdorff_distance_impl(const TriangleMesh1& tm1 OutputIterator& out) { #if !defined(CGAL_LINKED_WITH_TBB) || !defined(CGAL_METIS_ENABLED) - CGAL_static_assertion_msg(!(std::is_convertible::value), - "Parallel_tag is enabled but at least TBB or METIS is unavailable."); + static_assert(!std::is_convertible::value, + "Parallel_tag is enabled but at least TBB or METIS is unavailable."); #endif using FT = typename Kernel::FT; @@ -2270,8 +2270,8 @@ bounded_error_squared_symmetric_Hausdorff_distance_impl(const TriangleMesh1& tm1 OutputIterator2& out2) { #if !defined(CGAL_LINKED_WITH_TBB) || !defined(CGAL_METIS_ENABLED) - CGAL_static_assertion_msg(!(std::is_convertible::value), - "Parallel_tag is enabled but at least TBB or METIS is unavailable."); + static_assert(!std::is_convertible::value, + "Parallel_tag is enabled but at least TBB or METIS is unavailable."); #endif // Optimized version. diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 28958df8ac0..60829f72623 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -151,11 +151,11 @@ bool fair(TriangleMesh& tmesh, #endif #if defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg( + static_assert( (!std::is_same::type, bool>::value) || EIGEN_VERSION_AT_LEAST(3, 2, 0), "The function `fair` requires Eigen3 version 3.2 or later."); #else - CGAL_static_assertion_msg( + static_assert( (!std::is_same::type, bool>::value), "The function `fair` requires Eigen3 version 3.2 or later."); #endif 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 47be440cd3a..652d0b09952 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 @@ -98,7 +98,7 @@ intersection_type( typedef typename boost::property_traits::value_type Point_3; typedef typename Kernel_traits::Kernel Kernel; - CGAL_static_assertion((std::is_same::value_type>::value)); + static_assert(std::is_same::value_type>::value); halfedge_descriptor h_2=halfedge(f_2,tm2); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h index 42629a5b679..c6f64c98322 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h @@ -48,8 +48,8 @@ public: private: //typedefs typedef typename boost::property_traits::value_type Point_3; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); typedef typename Kernel_traits::Kernel Input_kernel; typedef std::vector Nodes_vector; @@ -150,8 +150,8 @@ public: private: typedef typename boost::property_traits::value_type Point_3; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); typedef typename Kernel_traits::Kernel Input_kernel; @@ -327,8 +327,8 @@ class Intersection_nodes::value_type Point_3; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); typedef typename Kernel_traits::Kernel Input_kernel; typedef std::vector Nodes_vector; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_of_coplanar_triangles_3.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_of_coplanar_triangles_3.h index 45369d47bf5..a67631290d5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_of_coplanar_triangles_3.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_of_coplanar_triangles_3.h @@ -32,8 +32,8 @@ struct Intersect_coplanar_faces_3 // typedefs typedef typename boost::property_traits::value_type Point; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); typedef typename CGAL::Kernel_traits::Kernel Input_kernel; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index b7f158d6814..337cdcb0ad8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -960,7 +960,7 @@ std::size_t snap_non_conformal_one_way(const HalfedgeRange& halfedge_range_S, #endif #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else // CGAL_LINKED_WITH_TBB if(std::is_convertible::value) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h index b8edbdfd807..5adbf99ff6f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h @@ -371,7 +371,7 @@ void find_vertex_vertex_matches_with_kd_tree(Unique_positions& unique_positions_ tree.insert(unique_positions_Bv.begin(), unique_positions_Bv.end()); #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else // parallel @@ -596,7 +596,7 @@ void find_vertex_vertex_matches_with_box_d(const Unique_positions& unique_positi boxes_B_ptr.push_back(&b); #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else // CGAL_LINKED_WITH_TBB if(std::is_convertible::value) @@ -730,7 +730,7 @@ std::size_t snap_vertices_two_way(const HalfedgeRange_A& halfedge_range_A, using parameters::get_parameter; using parameters::get_parameter_reference; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); GT gt = choose_parameter(get_parameter(np_A, internal_np::geom_traits)); VPM_A vpm_A = choose_parameter(get_parameter(np_A, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 30b0fef1855..26e205ea43d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -425,7 +425,7 @@ compute_face_face_intersection(const FaceRange& face_range1, get_const_property_map(boost::vertex_point, tm1)); VertexPointMap2 vpmap2 = choose_parameter(get_parameter(np2, internal_np::vertex_point), get_const_property_map(boost::vertex_point, tm2)); - CGAL_static_assertion( + static_assert( (std::is_same< typename boost::property_traits::value_type, typename boost::property_traits::value_type @@ -543,7 +543,7 @@ compute_face_polyline_intersection(const FaceRange& face_range, VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, tm)); typedef typename boost::property_traits::value_type Point; - CGAL_static_assertion( + static_assert( (std::is_same::type>::value)); @@ -681,7 +681,7 @@ compute_face_polylines_intersection(const FaceRange& face_range, get_const_property_map(boost::vertex_point, tm)); typedef typename boost::property_traits::value_type Point; typedef typename boost::range_value::type Polyline; - CGAL_static_assertion((std::is_same::type>::value)); + static_assert(std::is_same::type>::value); std::vector faces; faces.reserve(std::distance( std::begin(face_range), std::end(face_range) )); @@ -1742,8 +1742,8 @@ surface_intersection(const TriangleMesh& tm1, typedef typename GetVertexPointMap::const_type VPM1; typedef typename GetVertexPointMap::const_type VPM2; - CGAL_static_assertion((std::is_same::value_type, - typename boost::property_traits::value_type>::value)); + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value); VPM1 vpm1 = parameters::choose_parameter(parameters::get_parameter(np1, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, tm1)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 956262a6413..26d0266e03a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -1661,7 +1661,7 @@ locate_with_AABB_tree(const typename internal::Location_traits AABB_traits; typedef typename Primitive::Point Point_3; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); typedef typename GetVertexPointMap::const_type VertexPointMap; typedef internal::Point_to_Point_3_VPM WrappedVPM; @@ -1754,7 +1754,7 @@ locate(const typename internal::Location_traits:: using parameters::get_parameter; using parameters::choose_parameter; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); const VertexPointMap vpm = parameters::choose_parameter(parameters::get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, tm)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h index 468896b5a98..8f1c60347ee 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -989,8 +989,8 @@ void match_faces(const PolygonMesh1& m1, get_const_property_map(vertex_point, m1)); const VPMap2 vpm2 = choose_parameter(get_parameter(np2, internal_np::vertex_point), get_const_property_map(vertex_point, m2)); - CGAL_static_assertion_msg((std::is_same::value_type, - typename boost::property_traits::value_type>::value), + static_assert(std::is_same::value_type, + typename boost::property_traits::value_type>::value, "Both vertex point maps must have the same point type."); const VIMap1 vim1 = get_initialized_vertex_index_map(m1, np1); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h index 1fa539d9bc7..c2f32374480 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h @@ -159,7 +159,7 @@ void orient_triangle_soup_with_reference_triangle_soup(const ReferencePointRange typedef typename boost::property_traits::reference PM2_Point_ref; typedef typename boost::property_traits::value_type Point_3; - CGAL_static_assertion((std::is_same::value_type>::value)); + static_assert(std::is_same::value_type>::value); typedef typename CGAL::Kernel_traits::Kernel K; typedef typename K::Triangle_3 Triangle; @@ -215,8 +215,8 @@ void orient_triangle_soup_with_reference_triangle_soup(const ReferencePointRange }; #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #else if(std::is_convertible::value) tbb::parallel_for(std::size_t(0), faces.size(), std::size_t(1), process_facet); @@ -309,7 +309,7 @@ void orient_triangle_soup_with_reference_triangle_mesh(const TriangleMesh& tm_re PointMap point_map = NP_helper::get_const_point_map(points, np2); - CGAL_static_assertion((std::is_same::value_type>::value)); + static_assert(std::is_same::value_type>::value); K k = choose_parameter(get_parameter(np1, internal_np::geom_traits)); @@ -352,8 +352,8 @@ void orient_triangle_soup_with_reference_triangle_mesh(const TriangleMesh& tm_re }; #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) tbb::parallel_for(std::size_t(0), triangles.size(), std::size_t(1), process_facet); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h index d0b22f7b5ef..eed98878632 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h @@ -39,7 +39,7 @@ struct PM_to_PS_point_converter { PS_Point operator()(const PM_Point& p) const { - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); return PS_Point(p); } }; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index a3ba31c2726..5e829a15c64 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -43,7 +43,7 @@ namespace internal { template PM_Point convert_to_pm_point(const PS_Point& p) { - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); return PM_Point(p); } @@ -353,10 +353,10 @@ void polygon_soup_to_polygon_mesh(const PointRange& points, choose_parameter(get_parameter(np_ps, internal_np::polygon_to_face_output_iterator), impl::make_functor(get_parameter(np_ps, internal_np::polygon_to_face_map)))); - CGAL_static_assertion_msg( + static_assert( (parameters::is_default_parameter::value), "Named parameter vertex_to_vertex_map was renamed point_to_vertex_map"); - CGAL_static_assertion_msg( + static_assert( (parameters::is_default_parameter::value), "Named parameter face_to_face_map was renamed polygon_to_face_map"); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index 584358ccefa..3a5f9fca82f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -178,7 +178,7 @@ FaceOutputIterator replace_faces_with_patch(const std::vector::value_type, Point>::value)); + static_assert(std::is_same::value_type, Point>::value); typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h index 3524b46c775..3d085dbb27f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h @@ -423,7 +423,7 @@ self_intersections_impl(const FaceRange& face_range, Throwing_filter throwing_filter(tmesh, vpmap, gt, Throwing_output_iterator()); #if !defined(CGAL_LINKED_WITH_TBB) - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if(std::is_convertible::value) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h index bd4e8ad8ab2..5fa0076b537 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h @@ -154,11 +154,11 @@ void smooth_shape(const FaceRange& faces, #endif #if defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg( + static_assert( (!std::is_same::type, bool>::value) || EIGEN_VERSION_AT_LEAST(3, 2, 0), "Eigen3 version 3.2 or later is required."); #else - CGAL_static_assertion_msg( + static_assert( (!std::is_same::type, bool>::value), "Eigen3 version 3.2 or later is required."); #endif diff --git a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h index e6b66f2145c..bde9c86826e 100644 --- a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h +++ b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h @@ -250,7 +250,7 @@ public: { // handle vpm typedef typename CGAL::GetVertexPointMap::const_type Local_vpm; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); Vpm vpm = parameters::choose_parameter(parameters::get_parameter(np, internal_np::vertex_point), @@ -562,7 +562,7 @@ public: parameters::get_parameter(np, internal_np::apply_per_connected_component), true); typedef typename CGAL::GetVertexPointMap::const_type Local_vpm; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); Vpm vpm = parameters::choose_parameter(parameters::get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h b/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h index 00bc1225b14..458fc0a703c 100644 --- a/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h +++ b/Polygon_mesh_processing/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Polyhedral_envelope_filter.h @@ -58,7 +58,7 @@ private: template void initialize_envelope(const Profile& profile) const { - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); typedef typename Profile::Triangle_mesh Triangle_mesh; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp index 2767dad9338..60c14ec9604 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp @@ -522,7 +522,7 @@ struct Locate_with_AABB_tree_Tester // 2D case typedef CGAL::AABB_face_graph_triangle_primitive AABB_face_graph_primitive; typedef CGAL::AABB_traits AABB_face_graph_traits; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); Intrinsic_point_to_Point_3 to_p3; @@ -633,7 +633,7 @@ struct Locate_with_AABB_tree_Tester // 3D typedef CGAL::AABB_traits AABB_face_graph_traits; typedef typename K::Point_3 Point_3; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); CGAL::AABB_tree tree_a; Point_reference p3_a = get(vpm, v); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp index fd052aaf825..0e4b1167f5a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp @@ -343,7 +343,7 @@ void Polyhedron_demo_polylines_io_plugin::simplify() { Scene_polylines_item* item = qobject_cast(scene->item(scene->mainSelectionIndex())); bool ok; - double err = QInputDialog::getDouble(mw, "Squared Frechet Distance", "Enter the squared approximation error:", pow(0.01*item->diagonalBbox(),2),0,999,8,&ok); + double err = QInputDialog::getDouble(mw, "Squared Frechet Distance", "Enter the squared approximation error:", pow(0.01*item->bboxDiagonal(),2),0,999,8,&ok); if(!ok) return; for(Scene_polylines_item::Polylines_container::iterator diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 7a889e4da14..9139fdd2590 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -138,7 +138,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), - /*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) + /*verbose = */false, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) { update_c3t3(item->c3t3()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index eb4e9c5b57d..2cc3f58854f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -116,3 +116,16 @@ if(TBB_FOUND) target_link_libraries(c3t3_io_plugin PUBLIC CGAL::TBB_support) target_link_libraries(c3t3_rib_exporter_plugin PUBLIC CGAL::TBB_support) endif() + +qt5_wrap_ui(offsetMeshingUI_FILES Offset_meshing_dialog.ui) +polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin + ${offsetMeshingUI_FILES}) +target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item + scene_polygon_soup_item + scene_polylines_item) +if(TARGET CGAL::Eigen3_support) + target_link_libraries(offset_meshing_plugin PUBLIC CGAL::Eigen3_support) +endif() +if(TARGET CGAL::TBB_support) + target_link_libraries(offset_meshing_plugin PUBLIC CGAL::TBB_support) +endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_dialog.ui similarity index 81% rename from Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui rename to Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_dialog.ui index 37b9073000f..33df99c77bb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_dialog.ui @@ -1,64 +1,70 @@ - Remeshing_dialog - + Offset_meshing_dialog + 0 0 - 376 - 216 + 413 + 294 Meshing criteria - + 25.0 - - - - 0.00 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - + + - Approximation &error: + Edge size Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 0.00 - - - - - - - &Topological criterion: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - tags - - - + + + true + + + 0.00 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + @@ -77,43 +83,47 @@ - - - - Qt::Vertical + + + + Topological criterion - - - 20 - 40 - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + tags - - - true - + 0.00 - - + + - &Edge size: + Approximation error + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0.00 + + + + + + + Size Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -121,22 +131,24 @@ - + - &Size: + Angle Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - &Angle: + + + + + 15 + - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + Meshing Criteria @@ -154,7 +166,7 @@ buttonBox accepted() - Remeshing_dialog + Offset_meshing_dialog accept() @@ -170,7 +182,7 @@ buttonBox rejected() - Remeshing_dialog + Offset_meshing_dialog reject() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_plugin.cpp new file mode 100644 index 00000000000..8b0e0bab57b --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Offset_meshing_plugin.cpp @@ -0,0 +1,765 @@ +#include "config.h" + +#ifdef CGAL_POLYHEDRON_DEMO_USE_SURFACE_MESHER + +#include +#include "ui_Offset_meshing_dialog.h" + +#include "C3t3_type.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include "Scene_surface_mesh_item.h" +#include "Scene_polygon_soup_item.h" +#include "Scene_polylines_item.h" +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace CGAL::Three; + +namespace CGAL { + +template +class Offset_function +{ + using Primitive = AABB_face_graph_triangle_primitive; + using Traits = AABB_traits; + using Tree = AABB_tree; + using Side_of = Side_of_triangle_mesh; + + using FT = typename GeomTraits::FT; + using Point_3 = typename GeomTraits::Point_3; + +public: + Offset_function(const TriangleMesh& tm, + double offset_distance) + : m_tree_ptr(std::make_shared(std::begin(faces(tm)), std::end(faces(tm)), tm)), + m_side_of_ptr(std::make_shared(*m_tree_ptr)), + m_is_inset(offset_distance < 0), + m_sq_offset_distance(CGAL::square(offset_distance)), + m_is_closed(is_closed(tm)) + { + CGAL_assertion(!m_tree_ptr->empty()); + } + + // we only need negative inside, and positive outside, so we can compare square roots + double operator()(const Point_3& p) const + { + const Bounded_side side = m_is_closed ? m_side_of_ptr->operator()(p) : ON_UNBOUNDED_SIDE; + + if(m_is_inset) // also means that the mesh is closed + { + // - ON_UNBOUNDED_SIDE is outside the offset since we are insetting + // - ON_BOUNDARY is outside the offset since we are insetting + if(side != ON_BOUNDED_SIDE) + return 1; + + // inside the offset if the distance to the input mesh is greater than the offset distance + const FT sq_distance = m_tree_ptr->squared_distance(p); + return (sq_distance > m_sq_offset_distance) ? -1 : 1; + } + else // outset + { + // - ON_BOUNDED_SIDE can only happen if it's a closed mesh, and in that case, being inside + // the mesh is being inside the offset + // - ON_BOUNDARY is in the offset whether the mesh is open or closed + if(side != ON_UNBOUNDED_SIDE) + return - 1; + + // inside the offset if the distance to the input mesh is smaller than the offset distance + const FT sq_distance = m_tree_ptr->squared_distance(p); + return (sq_distance < m_sq_offset_distance) ? -1 : 1; + } + } + +private: + std::shared_ptr m_tree_ptr; + std::shared_ptr m_side_of_ptr; + const bool m_is_inset; + const double m_sq_offset_distance; + const bool m_is_closed; +}; + +template +class Polygon_soup_offset_function +{ + using Polygon_iterator = typename Polygons::const_iterator; + + class Polygon_soup_point_property_map + { + const Points* points_vector_ptr; + + public: + using key_type = Polygon_iterator; + using value_type = EPICK::Point_3; + using reference = const value_type&; + using category = boost::readable_property_map_tag; + + Polygon_soup_point_property_map() = default; + Polygon_soup_point_property_map(const Points* ptr) : points_vector_ptr(ptr) { } + + friend reference get(Polygon_soup_point_property_map map, + key_type polygon_it) + { + return (*map.points_vector_ptr)[*polygon_it->begin()]; + } + }; + + class Polygon_soup_triangle_property_map + { + const Points* points_vector_ptr; + + public: + using key_type = Polygon_iterator; + using value_type = EPICK::Triangle_3; + using reference = value_type; + using category = boost::readable_property_map_tag; + + Polygon_soup_triangle_property_map() = default; + Polygon_soup_triangle_property_map(const Points* ptr) : points_vector_ptr(ptr) { } + + friend value_type get(Polygon_soup_triangle_property_map map, + key_type polygon_it) + { + auto it = polygon_it->begin(); + CGAL_assertion(it != polygon_it->end()); + const auto id0 = *it++; + CGAL_assertion(it != polygon_it->end()); + const auto id1 = *it++; + CGAL_assertion(it != polygon_it->end()); + const auto id2 = *it++; + CGAL_assertion(it == polygon_it->end()); + + return value_type((*map.points_vector_ptr)[id0], + (*map.points_vector_ptr)[id1], + (*map.points_vector_ptr)[id2]); + } + }; + + struct AABB_polygon_soup_triangle_primitive + : public CGAL::AABB_primitive + { + using Base = CGAL::AABB_primitive; + + using Id = Polygon_iterator; + + template + AABB_polygon_soup_triangle_primitive(Id id, + ObjectPmap&& opmap, + PointPmap&& ppmap) + : Base(id, std::forward(opmap), std::forward(ppmap)) + { + } + + template + AABB_polygon_soup_triangle_primitive(Iterator it, + ObjectPmap&& opmap, + PointPmap&& ppmap) + : Base(*it, std::forward(opmap), std::forward(ppmap)) + { + } + }; // struct template Polygon_soup_primitive + + using AABB_traits = CGAL::AABB_traits; + using AABB_tree = CGAL::AABB_tree; + + std::shared_ptr m_tree_ptr; + double m_sq_offset_distance; + +public: + Polygon_soup_offset_function(const Points& points, + const Polygons& polygons, + const double offset_distance) + : m_tree_ptr(std::make_shared(std::begin(polygons), + std::end(polygons), + Polygon_soup_triangle_property_map(&points), + Polygon_soup_point_property_map(&points))), + m_sq_offset_distance(square(offset_distance)) + { + CGAL_assertion(!m_tree_ptr->empty()); + } + + // we only need negative inside, and positive outside, so we can compare square roots + double operator()(const EPICK::Point_3& p) const + { + // it's a soup so it's open by definition ==> treat inset and outset identically + const double sq_distance = m_tree_ptr->squared_distance(p); + return sq_distance - m_sq_offset_distance; + } + +}; // class Polygon_soup_offset_function + +} // namespace CGAL + +CGAL::Offset_function +offset_function(Scene_surface_mesh_item* item, double offset_value) +{ + return { *(item->face_graph()), offset_value }; +} + +CGAL::Polygon_soup_offset_function +offset_function(Scene_polygon_soup_item* item, double offset_value) +{ + return { item->points(), item->polygons(), offset_value }; +} + +class MeshGuard +{ + SMesh* mesh; + bool done; + +public: + MeshGuard(SMesh* mesh) : mesh(mesh), done(false) { } + void setDone() { done = true; } + ~MeshGuard() + { + if(!done) + delete mesh; + } +}; + +// declare the CGAL function +template +SMesh* cgal_off_meshing(QWidget*, + SourceItem* source_item, + Scene_polylines_item* polylines_item, + const double offset_value, + const double angle, + const double sizing, + const double approx, + const double edge_size, + int tag) +{ + using GT = EPICK; + using Sphere_3 = GT::Sphere_3; + + using Mesh_domain_base = CGAL::Labeled_mesh_domain_3; + using Mesh_domain = CGAL::Mesh_domain_with_polyline_features_3; + using Tr = C3t3::Triangulation; + using Mesh_criteria = CGAL::Mesh_criteria_3; + + const CGAL::Bbox_3 bbox = source_item->bbox(); + + const GT::Point_3 center((bbox.xmax() + bbox.xmin()) / 2, + (bbox.ymax() + bbox.ymin()) / 2, + (bbox.zmax() + bbox.zmin()) / 2); + const double rad = 0.6 * std::sqrt(CGAL::square(bbox.xmax() - bbox.xmin()) + + CGAL::square(bbox.ymax() - bbox.ymin()) + + CGAL::square(bbox.zmax() - bbox.zmin())) + + offset_value; + const double sqrad = CGAL::square(rad); + + CGAL::Timer timer; + timer.start(); + + namespace p = CGAL::parameters; + + Mesh_domain domain = + Mesh_domain::create_implicit_mesh_domain + (p::function = offset_function(source_item, offset_value), + p::bounding_object = Sphere_3(center, sqrad), + p::relative_error_bound = 1e-7, + p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); + + const CGAL::Mesh_facet_topology topology = CGAL::FACET_VERTICES_ON_SAME_SURFACE_PATCH; + auto manifold_option = p::non_manifold(); + if(tag == 1) + manifold_option = p::manifold_with_boundary(); + if(tag == 2) + manifold_option = p::manifold(); + + Mesh_criteria criteria(p::facet_angle = angle, + p::facet_size = sizing, + p::facet_distance = approx, + p::facet_topology = topology, + p::edge_size = edge_size); + + if(polylines_item != nullptr) + { + typedef std::vector Surface_patch_ids; + std::vector surface_patch_ids; + + domain.add_features_and_incidences(polylines_item->polylines.begin(), + polylines_item->polylines.end(), + CGAL::Identity_property_map(), + CGAL::Constant_property_map(surface_patch_ids)); + } + + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + p::no_perturb(), + p::no_exude(), + manifold_option); + + timer.stop(); + std::cerr << "done (" << timer.time() << " ms, " << c3t3.triangulation().number_of_vertices() << " vertices)" << std::endl; + + if(c3t3.number_of_facets_in_complex() > 0) + { + SMesh* pRemesh = new SMesh(); + + // if the thread is interrupted before the mesh is returned, delete it. + MeshGuard guard(pRemesh); + CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, *pRemesh); + guard.setDone(); + + CGAL_postcondition(CGAL::Polygon_mesh_processing::is_outward_oriented(*pRemesh)); + + return pRemesh; + } + else + { + return nullptr; + } +} + +struct Mesher_thread + : public QThread +{ + Q_OBJECT + +private: + Scene_surface_mesh_item* sm_item; + Scene_polygon_soup_item* soup_item; + Scene_polylines_item* polylines_item; + + const double offset_value; + const double angle; + const double sizing; + const double approx; + const double edge_size; + int tag_index; + +public: + Mesher_thread(Scene_surface_mesh_item* sm_item, + Scene_polygon_soup_item* soup_item, + Scene_polylines_item* polylines_item, + const double offset_value, + const double angle, + const double sizing, + const double approx, + const double edge_size, + int tag) + : sm_item(sm_item), soup_item(soup_item), polylines_item(polylines_item), + offset_value(offset_value), + angle(angle), sizing(sizing), approx(approx), edge_size(edge_size), tag_index(tag) + { + } + + void run() override + { + SMesh* offset_mesh = nullptr; + + if(soup_item) + { + offset_mesh = cgal_off_meshing(Three::mainWindow(), + soup_item, polylines_item, + offset_value, + angle, sizing, approx, edge_size, tag_index); + } + else + { + offset_mesh = cgal_off_meshing(Three::mainWindow(), + sm_item, polylines_item, + offset_value, + angle, sizing, approx, edge_size, tag_index); + } + + Three::getMutex()->lock(); + Three::getWaitCondition()->wakeAll(); + Three::getMutex()->unlock(); + + Q_EMIT resultReady(offset_mesh); + } + +Q_SIGNALS: + void resultReady(SMesh *offset_mesh); +}; + +class Polyhedron_demo_offset_meshing_plugin + : public QObject, + protected Polyhedron_demo_plugin_interface +{ + Q_OBJECT + Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface) + Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") + +private: + QAction* actionOffsetMeshing; + QAction* actionInflateMesh; + + Scene_interface *scene; + QMainWindow *mw; + +public: + void init(QMainWindow* mainWindow, + Scene_interface* scene_interface, + Messages_interface*) + { + this->scene = scene_interface; + this->mw = mainWindow; + + actionOffsetMeshing = new QAction(tr("Offset Meshing"), mw); + actionOffsetMeshing->setProperty("subMenuName", "3D Surface Mesh Generation"); + connect(actionOffsetMeshing, SIGNAL(triggered()), + this, SLOT(offset_meshing())); + + actionInflateMesh = new QAction(tr("Inflate Mesh"), mw); + actionInflateMesh->setProperty("subMenuName", "Operations on Polyhedra"); + connect(actionInflateMesh, SIGNAL(triggered()), + this, SLOT(inflate_mesh())); + } + + bool applicable(QAction* action) const + { + if(action == actionOffsetMeshing) + { + if(scene->selectionIndices().size() == 1) + { + const int index = scene->mainSelectionIndex(); + return (qobject_cast(scene->item(index)) || + qobject_cast(scene->item(index))); + } + + // Can provide a polyline item for feature protection + if(scene->selectionIndices().size() != 2) + return false; + + // One needs to be a surface mesh or polygon soup item, and the other a polyline item + const int index1 = scene->selectionIndices().at(0); + const int index2 = scene->selectionIndices().at(1); + Scene_item* item1 = scene->item(index1); + Scene_item* item2 = scene->item(index2); + + if((qobject_cast(item1) || + qobject_cast(item1)) && + qobject_cast(item2)) + return true; + + if((qobject_cast(item2) || + qobject_cast(item2)) && + qobject_cast(item1)) + return true; + } + else if(action == actionInflateMesh) + { + if(scene->selectionIndices().size() == 1) + { + const int index = scene->mainSelectionIndex(); + return qobject_cast(scene->item(index)); + } + } + + return false; + } + + QList actions() const + { + return QList() << actionOffsetMeshing + << actionInflateMesh; + } + +public Q_SLOTS: + void offset_meshing(); + void inflate_mesh(); +}; // class Polyhedron_demo_offset_meshing_plugin + +void +Polyhedron_demo_offset_meshing_plugin:: +offset_meshing() +{ + Scene_item* item = nullptr; + Scene_surface_mesh_item* sm_item = nullptr; + Scene_polygon_soup_item* soup_item = nullptr; + Scene_polylines_item* polylines_item = nullptr; + + bool mesh_or_soup_item_found = false; + Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices()) + { + if(!mesh_or_soup_item_found) + { + sm_item = qobject_cast(scene->item(index)); + if(sm_item == nullptr) + { + soup_item = qobject_cast(scene->item(index)); + if(soup_item != nullptr) + { + item = scene->item(index); + mesh_or_soup_item_found = true; + continue; + } + } + else + { + item = scene->item(index); + mesh_or_soup_item_found = true; + continue; + } + } + + polylines_item = qobject_cast(scene->item(index)); + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + + if(!mesh_or_soup_item_found) + return; + + if(sm_item) + { + if(!is_triangle_mesh(*(sm_item->face_graph()))) + { + QMessageBox::critical(mw, + tr("Offset Meshing"), + tr("The selected mesh is not a triangle mesh.")); + return; + } + } + else + { + for(const auto& p : soup_item->polygons()) + { + if(p.size() != 3) + { + QMessageBox::critical(mw, + tr("Offset Meshing"), + tr("The selected polygon soup is not a triangle soup.")); + return; + } + } + } + + double diag; + if(sm_item) + diag = sm_item->bboxDiagonal(); + else + diag = soup_item->bboxDiagonal(); + + QApplication::restoreOverrideCursor(); + + bool ok = true; + double offset_value = QInputDialog::getDouble(mw, + QString("Choose Offset Value"), + QString("Offset Value (use a negative number to compute the inset of a closed mesh)"), + 0.1 * diag, + - (std::numeric_limits::max)(), + (std::numeric_limits::max)(), 10, &ok); + if(!ok) + return; + + if(offset_value < 0 && (!sm_item || !is_closed(*(sm_item->face_graph())))) + { + QMessageBox::critical(mw, + tr("Offset Meshing"), + tr("Insetting is only possible for closed polygon meshes.")); + return; + } + + QDialog dialog(mw); + Ui::Offset_meshing_dialog ui; + ui.setupUi(&dialog); + ui.angle->setRange(1.0, 30.0); + + connect(ui.buttonBox, SIGNAL(accepted()), + &dialog, SLOT(accept())); + connect(ui.buttonBox, SIGNAL(rejected()), + &dialog, SLOT(reject())); + + ui.sizing->setRange(diag * 10e-6, diag); + ui.sizing->setValue(diag * 0.05); // default value + ui.approx->setRange(diag * 10e-7, diag); + ui.approx->setValue(diag * 0.005); + + if(polylines_item != nullptr) + { + ui.edge_sizing->setRange(diag * 10e-6, diag); + ui.edge_sizing->setValue(diag * 0.05); // default value + } + else + { + ui.edge_sizing->setEnabled(false); + } + + int i = dialog.exec(); + if(i == QDialog::Rejected) + return; + + const double angle = ui.angle->value(); + const double approx = ui.approx->value(); + const double sizing = ui.sizing->value(); + const double edge_size = (polylines_item != nullptr) ? ui.edge_sizing->value() : 0; + const int tag_index = ui.tags->currentIndex(); + + if(tag_index < 0) + return; + + QApplication::setOverrideCursor(Qt::BusyCursor); + + std::cerr << "mesh with:" + << "\n angle= " << angle + << "\n sizing= " << sizing + << "\n approx= " << approx + << "\n tag= " << tag_index + << std::boolalpha + << std::endl; + + Mesher_thread* worker = nullptr; + if(soup_item) + { + worker = new Mesher_thread(nullptr, soup_item, polylines_item, + offset_value, + angle, sizing, approx, edge_size, tag_index); + } + else + { + worker = new Mesher_thread(sm_item, nullptr, polylines_item, + offset_value, + angle, sizing, approx, edge_size, tag_index); + } + + connect(worker, &QThread::finished, + worker, &QObject::deleteLater); + + connect(worker, &Mesher_thread::resultReady, + this, [item, angle, sizing, approx, offset_value/* , index */](SMesh* offset_mesh) + { + if(!offset_mesh) + { + QApplication::restoreOverrideCursor(); + + Three::getMutex()->lock(); + Three::isLocked() = false; + Three::getMutex()->unlock(); + + return; + } + + Scene_surface_mesh_item* offset_item = new Scene_surface_mesh_item(offset_mesh); + offset_item->setName(tr("%1 offset %5 (%2 %3 %4)").arg(item->name()) + .arg(angle) + .arg(sizing) + .arg(approx) + .arg(offset_value)); + offset_item->setColor(Qt::magenta); + offset_item->setRenderingMode(Wireframe); + Three::scene()->addItem(offset_item); + + QApplication::restoreOverrideCursor(); + + Three::getMutex()->lock(); + Three::isLocked() = false; + Three::getMutex()->unlock(); + }); + + QMessageBox* message_box = new QMessageBox(QMessageBox::NoIcon, + "Meshing", + "Offset meshing in progress...", + QMessageBox::Cancel, + mw); + message_box->setDefaultButton(QMessageBox::Cancel); + QAbstractButton* cancelButton = message_box->button(QMessageBox::Cancel); + cancelButton->setText(tr("Stop")); + + connect(cancelButton, &QAbstractButton::clicked, + this, [worker](){ worker->terminate(); }); + connect(worker, &Mesher_thread::finished, + message_box, &QMessageBox::close); + + Three::getMutex()->lock(); + Three::isLocked() = true; + Three::getMutex()->unlock(); + + message_box->open(); + worker->start(); +} + +void +Polyhedron_demo_offset_meshing_plugin:: +inflate_mesh() +{ + const Scene_interface::Item_id index = scene->mainSelectionIndex(); + Scene_item* item = scene->item(index); + if(item == nullptr) + return; + + Scene_surface_mesh_item* sm_item = qobject_cast(item); + if(sm_item == nullptr) + return; + + SMesh* sMesh = sm_item->face_graph(); + if(sMesh == nullptr) + return; + + const double diag = sm_item->bboxDiagonal(); + + bool ok = true; + const double offset_value = QInputDialog::getDouble(mw, + QString("Choose Inflate Distance"), + QString("Inflate Distance (use a negative number to deflate)"), + 0.1 * diag, + -(std::numeric_limits::max)(), + (std::numeric_limits::max)(), + 10, + &ok); + if(!ok) + return; + + auto vpm = get(CGAL::vertex_point, *sMesh); + auto vnm = sMesh->property_map("v:normal").first; + + QApplication::setOverrideCursor(Qt::WaitCursor); + + for(const auto& v : vertices(*sMesh)) + { + const EPICK::Vector_3& n = get(vnm, v); + put(vpm, v, get(vpm, v) + offset_value * n); + } + + sm_item->invalidateOpenGLBuffers(); + sm_item->itemChanged(); + sm_item->itemVisibilityChanged(); + + QApplication::restoreOverrideCursor(); +} + +#include "Offset_meshing_plugin.moc" + +#endif // CGAL_POLYHEDRON_DEMO_USE_SURFACE_MESHER diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp index 308bd503d95..caea10065a9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp @@ -404,8 +404,8 @@ private Q_SLOTS: // compute centroid Point c = CGAL::centroid(triangles.begin(),triangles.end()); - oliver_queen = new Scene_arrow_item(Vec(c.x(),c.y(),c.z()), fg_item->diagonalBbox() / 50.0f, - fg_item->diagonalBbox()/3.0f); + oliver_queen = new Scene_arrow_item(Vec(c.x(),c.y(),c.z()), fg_item->bboxDiagonal() / 50.0f, + fg_item->bboxDiagonal()/3.0f); Vec dir(plane.orthogonal_vector().x(), plane.orthogonal_vector().y(), plane.orthogonal_vector().z()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index 1cae60b9a70..5ecc8921433 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -192,7 +192,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveNeedlesAndCaps_tri QDialog dialog; Ui::NeedleDialog ui; ui.setupUi(&dialog); - ui.collapseBox->setValue(sm_item->diagonalBbox()*0.01); + ui.collapseBox->setValue(sm_item->bboxDiagonal()*0.01); if(dialog.exec() != QDialog::Accepted) return; CGAL::Polygon_mesh_processing::remove_almost_degenerate_faces(*sm_item->face_graph(), diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index fc344cec857..68a1fe2c6d3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -928,7 +928,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t dialog.m_cluster_epsilon_field->setEnabled(false); dialog.groupBox_3->setEnabled(false); //todo: check default values - dialog.m_epsilon_field->setValue(0.01*sm_item->diagonalBbox()); + dialog.m_epsilon_field->setValue(0.01*sm_item->bboxDiagonal()); std::size_t nb_faces = mesh->number_of_faces(); dialog.m_min_pts_field->setValue((std::max)(static_cast(0.01*nb_faces), 1)); if(!dialog.exec()) return; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp index 84e3b4702ce..87bb50fd96f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp @@ -95,16 +95,19 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_loop(FaceGraphItem* item, void Polyhedron_demo_subdivision_methods_plugin::on_actionLoop_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(!sm_item) return; + + bool ok = true; int nb_steps = QInputDialog::getInt(mw, QString("Number of Iterations"), QString("Choose number of iterations"), - 1, - 1); + 1 /* value */, 1 /* min */, (std::numeric_limits::max)() /* max */, 1 /*step*/, + &ok); + if(!ok) + return; + apply_loop(sm_item, nb_steps); } @@ -123,18 +126,23 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_catmullclark(FaceGraphIte item->invalidateOpenGLBuffers(); scene->itemChanged(item); } + void Polyhedron_demo_subdivision_methods_plugin::on_actionCatmullClark_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(!sm_item) return; + + bool ok = true; int nb_steps = QInputDialog::getInt(mw, QString("Number of Iterations"), QString("Choose number of iterations"), - 1, - 1); + 1 /* value */, 1 /* min */, (std::numeric_limits::max)() /* max */, 1 /*step*/, + &ok); + if(!ok) + return; + apply_catmullclark(sm_item, nb_steps); } @@ -157,15 +165,19 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_sqrt3(FaceGraphItem* item void Polyhedron_demo_subdivision_methods_plugin::on_actionSqrt3_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(!sm_item) return; + + bool ok = true; int nb_steps = QInputDialog::getInt(mw, QString("Number of Iterations"), QString("Choose number of iterations"), - 1, - 1); + 1 /* value */, 1 /* min */, (std::numeric_limits::max)() /* max */, 1 /*step*/, + &ok); + if(!ok) + return; + apply_sqrt3(sm_item, nb_steps); } @@ -189,16 +201,19 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_doosabin(FaceGraphItem* i void Polyhedron_demo_subdivision_methods_plugin::on_actionDooSabin_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(!sm_item) return; + + bool ok = true; int nb_steps = QInputDialog::getInt(mw, QString("Number of Iterations"), QString("Choose number of iterations"), - 1, - 1); + 1 /* value */, 1 /* min */, (std::numeric_limits::max)() /* max */, 1 /*step*/, + &ok); + if(!ok) + return; + apply_doosabin(sm_item, nb_steps); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 508716a21e1..845dedbc31f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -41,18 +41,6 @@ if(NOT CGAL_DISABLE_GMP) polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item scene_selection_item) - qt5_wrap_ui(remeshingUI_FILES Remeshing_dialog.ui) - polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin - ${remeshingUI_FILES}) - target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item - scene_polygon_soup_item - scene_polylines_item) - if(TARGET CGAL::Eigen3_support) - target_link_libraries(offset_meshing_plugin PUBLIC CGAL::Eigen3_support) - endif() - if(TARGET CGAL::TBB_support) - target_link_libraries(offset_meshing_plugin PUBLIC CGAL::TBB_support) - endif() qt5_wrap_ui(shortestPathUI_FILES Shortest_path_widget.ui) polyhedron_demo_plugin(shortest_path_plugin Shortest_path_plugin diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index 1951ee8ff7c..1b54ec52993 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -22,7 +22,7 @@ CGAL::Three::Scene_item::Scene_item(int buffers_size, int vaos_size) CGAL::QGLViewer::QGLViewerPool().first()->makeCurrent(); is_bbox_computed = false; - is_diag_bbox_computed = false; + is_bbox_diag_computed = false; for(int i=0; iis_diag_bbox_computed) +double Scene_item_rendering_helper::bboxDiagonal() const { + if(!priv->is_bbox_diag_computed) priv->compute_diag_bbox(); - priv->is_diag_bbox_computed = true; + priv->is_bbox_diag_computed = true; return priv->_diag_bbox; } diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index 7ad2931f252..75bea895cfa 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -321,7 +321,7 @@ void Scene_points_with_normal_item_priv::compute_normals_and_vertices() const positions_selected_normals.resize(m_points->nb_selected_points() * 3); // we can't afford computing real average spacing just for display, 0.5% of bbox will do - average_spacing = 0.005 * item->diagonalBbox(); + average_spacing = 0.005 * item->bboxDiagonal(); normal_length = (std::min)(average_spacing, std::sqrt( region_of_interest.squared_radius() / 1000.)); length_factor = 10.0/100*normal_Slider->value(); diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index 363ef73cfa2..c284f6e60b1 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -30,7 +30,7 @@ namespace CGAL { typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) { - CGAL_static_assertion( LCC::dimension>=2 && LCC::ambient_dimension==3 ); + static_assert( LCC::dimension>=2 && LCC::ambient_dimension==3 ); typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; typedef typename Polyhedron::Facet_const_iterator Facet_iterator; diff --git a/Polynomial/include/CGAL/Exponent_vector.h b/Polynomial/include/CGAL/Exponent_vector.h index 72c5e1d8f26..1a06965514d 100644 --- a/Polynomial/include/CGAL/Exponent_vector.h +++ b/Polynomial/include/CGAL/Exponent_vector.h @@ -59,7 +59,7 @@ public: :v(begin,end){ typedef typename std::iterator_traits::value_type value_type; CGAL_USE_TYPE(value_type); - CGAL_static_assertion(( ::std::is_same::value)); + static_assert(::std::is_same::value); } diff --git a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h index b5576f5489c..f989b8ff201 100644 --- a/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h +++ b/Polynomial/include/CGAL/Polynomial/Algebraic_structure_traits.h @@ -273,9 +273,9 @@ class Polynomial_algebraic_structure_traits_base< POLY, Field_tag > template < class NT1, class NT2 > void operator()( const NT1& x, const NT2& y, POLY& q, POLY& r ) const { - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< typename Coercion_traits< NT1, NT2 >::Type, POLY - >::value)); + >::value); typename Coercion_traits< NT1, NT2 >::Cast cast; operator()( cast(x), cast(y), q, r ); diff --git a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h index f1055bedbd0..e2529d2e349 100644 --- a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h +++ b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h @@ -545,8 +545,8 @@ public: * Also available as non-member function. */ CGAL::Sign sign() const { -// CGAL_static_assertion( (std::is_same< typename Real_embeddable_traits::Is_real_embeddable, -// CGAL::Tag_true>::value) ); +// static_assert(std::is_same< typename Real_embeddable_traits::Is_real_embeddable, +// CGAL::Tag_true>::value); return CGAL::sign(lcoeff()); } diff --git a/Polynomial/include/CGAL/Polynomial/subresultants.h b/Polynomial/include/CGAL/Polynomial/subresultants.h index 4ea568bf212..e6f4eb40fcd 100644 --- a/Polynomial/include/CGAL/Polynomial/subresultants.h +++ b/Polynomial/include/CGAL/Polynomial/subresultants.h @@ -775,7 +775,7 @@ namespace CGAL { CGAL::Integral_domain_without_division_tag) { // polynomial_subresultants_with_cofactors requires // a model of IntegralDomain as coefficient type; - CGAL_static_assertion(sizeof(Polynomial_traits_d)==0); + static_assert(sizeof(Polynomial_traits_d)==0); return sres_out; } diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index 8172dd12395..f7a4d3993e3 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -566,7 +566,7 @@ public: template Polynomial_d construct_value_type(Input_iterator begin, Input_iterator end, NT) const { typedef CGAL::Coercion_traits CT; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); typename CT::Cast cast; return Polynomial_d( boost::make_transform_iterator(begin,cast), @@ -667,7 +667,7 @@ public: typedef Polynomial_traits_d PT; typename PT::Construct_polynomial construct; - CGAL_static_assertion(PT::d != 0); // Coefficient_type is a Polynomial + static_assert(PT::d != 0); // Coefficient_type is a Polynomial std::vector coefficients; Coefficient_type zero(0); diff --git a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h index c9097031598..b40a6d882f7 100644 --- a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h @@ -50,7 +50,7 @@ static CGAL::Random my_rnd(346); // some seed #define ASSERT_IS_NULL_FUNCTOR(T) \ - CGAL_static_assertion((std::is_same::value)) + static_assert(std::is_same::value) @@ -178,10 +178,10 @@ void test_construct_polynomial(const Polynomial_traits_d&){ } { // Construct_polynomial typedef typename PT::Construct_polynomial Constructor; - CGAL_static_assertion( + static_assert( !(std::is_same< Constructor , CGAL::Null_functor >::value)); typedef typename Constructor::result_type result_type; - CGAL_static_assertion( + static_assert( (std::is_same< result_type , Polynomial_d >::value)); CGAL_USE_TYPE(result_type); typedef typename PT::Shift Shift; @@ -1802,23 +1802,23 @@ void test_rebind(const PT& /*traits*/){ { typedef typename PT:: template Rebind::Other PT_IC_1; CGAL_USE_TYPE(PT_IC_1); - CGAL_static_assertion((std::is_same< typename PT_IC_1::Innermost_coefficient_type, - IC>::value)); - CGAL_static_assertion((PT_IC_1::d==1)); + static_assert(std::is_same< typename PT_IC_1::Innermost_coefficient_type, + IC>::value); + static_assert(PT_IC_1::d==1); } { typedef typename PT:: template Rebind::Other PT_IC_2; CGAL_USE_TYPE(PT_IC_2); - CGAL_static_assertion((std::is_same< typename PT_IC_2::Innermost_coefficient_type, - IC>::value)); - CGAL_static_assertion((PT_IC_2::d==2)); + static_assert(std::is_same< typename PT_IC_2::Innermost_coefficient_type, + IC>::value); + static_assert(PT_IC_2::d==2); } { typedef typename PT:: template Rebind::Other PT_IC_3; CGAL_USE_TYPE(PT_IC_3); - CGAL_static_assertion((std::is_same< typename PT_IC_3::Innermost_coefficient_type, - IC>::value)); - CGAL_static_assertion((PT_IC_3::d==3)); + static_assert(std::is_same< typename PT_IC_3::Innermost_coefficient_type, + IC>::value); + static_assert(PT_IC_3::d==3); } { typedef typename PT:: template Rebind::Other PT_IC_1; @@ -1831,12 +1831,12 @@ void test_rebind(const PT& /*traits*/){ typedef typename PT_IC_1::Polynomial_d Poly1; typedef typename PT_IC_2::Polynomial_d Poly2; - CGAL_static_assertion((std::is_same< typename PT_IC_1::Coefficient_type, - IC>::value)); - CGAL_static_assertion((std::is_same< typename PT_IC_2::Coefficient_type, - Poly1>::value)); - CGAL_static_assertion((std::is_same< typename PT_IC_3::Coefficient_type, - Poly2>::value)); + static_assert(std::is_same< typename PT_IC_1::Coefficient_type, + IC>::value); + static_assert(std::is_same< typename PT_IC_2::Coefficient_type, + Poly1>::value); + static_assert(std::is_same< typename PT_IC_3::Coefficient_type, + Poly2>::value); } @@ -1850,12 +1850,12 @@ void test_rebind(const PT& /*traits*/){ CGAL_USE_TYPE(PT_Integer_4); typedef typename PT:: template Rebind::Other PT_Rational_4; CGAL_USE_TYPE(PT_Rational_4); - CGAL_static_assertion((std::is_same< typename PT_Integer_4::Innermost_coefficient_type, - Integer>::value)); - CGAL_static_assertion((std::is_same< typename PT_Rational_4::Innermost_coefficient_type, - Rational>::value)); - CGAL_static_assertion((PT_Integer_4::d==dimension)); - CGAL_static_assertion((PT_Rational_4::d==dimension)); + static_assert(std::is_same< typename PT_Integer_4::Innermost_coefficient_type, + Integer>::value); + static_assert(std::is_same< typename PT_Rational_4::Innermost_coefficient_type, + Rational>::value); + static_assert(PT_Integer_4::d==dimension); + static_assert(PT_Rational_4::d==dimension); } #endif #ifdef CGAL_USE_CORE @@ -1867,12 +1867,12 @@ void test_rebind(const PT& /*traits*/){ typedef typename PT:: template Rebind::Other PT_Rational_4; CGAL_USE_TYPE(PT_Integer_4); CGAL_USE_TYPE(PT_Rational_4); - CGAL_static_assertion((std::is_same< typename PT_Integer_4::Innermost_coefficient_type, - Integer>::value)); - CGAL_static_assertion((std::is_same< typename PT_Rational_4::Innermost_coefficient_type, - Rational>::value)); - CGAL_static_assertion((PT_Integer_4::d==4)); - CGAL_static_assertion((PT_Rational_4::d==4)); + static_assert(std::is_same< typename PT_Integer_4::Innermost_coefficient_type, + Integer>::value); + static_assert(std::is_same< typename PT_Rational_4::Innermost_coefficient_type, + Rational>::value); + static_assert(PT_Integer_4::d==4); + static_assert(PT_Rational_4::d==4); } #endif { @@ -1880,12 +1880,12 @@ void test_rebind(const PT& /*traits*/){ typedef typename PT:: template Rebind::Other PT_Rational_4; CGAL_USE_TYPE(PT_Integer_4); CGAL_USE_TYPE(PT_Rational_4); - CGAL_static_assertion((std::is_same< typename PT_Integer_4::Innermost_coefficient_type, - int>::value)); - CGAL_static_assertion((std::is_same< typename PT_Rational_4::Innermost_coefficient_type, - double>::value)); - CGAL_static_assertion((PT_Integer_4::d==4)); - CGAL_static_assertion((PT_Rational_4::d==4)); + static_assert(std::is_same< typename PT_Integer_4::Innermost_coefficient_type, + int>::value); + static_assert(std::is_same< typename PT_Rational_4::Innermost_coefficient_type, + double>::value); + static_assert(PT_Integer_4::d==4); + static_assert(PT_Rational_4::d==4); } } diff --git a/Polynomial/test/Polynomial/Polynomial_type_generator.cpp b/Polynomial/test/Polynomial/Polynomial_type_generator.cpp index d2b0c931512..8d8497ed139 100644 --- a/Polynomial/test/Polynomial/Polynomial_type_generator.cpp +++ b/Polynomial/test/Polynomial/Polynomial_type_generator.cpp @@ -12,14 +12,14 @@ int main(){ { typedef CGAL::Polynomial_type_generator::Type Polynomial; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); } { typedef CGAL::Polynomial_type_generator::Type Polynomial; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); } { typedef CGAL::Polynomial_type_generator::Type Polynomial; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); } } diff --git a/Polynomial/test/Polynomial/test_polynomial.h b/Polynomial/test/Polynomial/test_polynomial.h index 5637578e945..c1943d96ae9 100644 --- a/Polynomial/test/Polynomial/test_polynomial.h +++ b/Polynomial/test/Polynomial/test_polynomial.h @@ -34,7 +34,7 @@ inline void convert_to(const NT& x, RT& r){ typedef CGAL::Coercion_traits CT; typedef typename CT::Coercion_type RET; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); r = typename CT::Cast()(x); } } //namespace CGAL @@ -887,7 +887,7 @@ void test_scalar_factor_traits(){ typedef CGAL::Scalar_factor_traits SFT; typedef typename AT::Integer Scalar; typedef typename SFT::Scalar Scalar_; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typename SFT::Scalar_factor sfac; @@ -913,7 +913,7 @@ void test_scalar_factor_traits(){ typedef CGAL::Scalar_factor_traits SFT; typedef typename AT::Integer Scalar; typedef typename SFT::Scalar Scalar_; - CGAL_static_assertion((::std::is_same::value)); + static_assert(::std::is_same::value); typename SFT::Scalar_factor sfac; diff --git a/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp b/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp index 5760a12eda0..ca30d9e8ed0 100644 --- a/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp +++ b/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp @@ -147,9 +147,9 @@ void test_coercion_traits(){ /* { typedef CGAL::Coercion_traits CT; - CGAL_static_assertion(( + static_assert( ::std::is_same< typename CT::Are_implicit_interoperable, - CGAL::Tag_false>::value)); + CGAL::Tag_false>::value); } */ diff --git a/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp b/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp index 7107ed8f04e..5edd4a40835 100644 --- a/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp +++ b/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp @@ -7,11 +7,11 @@ void test_get_arithmetic_kernel(){ { typedef CGAL::Polynomial POLY; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); }{ typedef CGAL::Polynomial > POLY; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_; - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); } } diff --git a/Ridges_3/include/CGAL/Ridges.h b/Ridges_3/include/CGAL/Ridges.h index e09c6eaf571..d4052642864 100644 --- a/Ridges_3/include/CGAL/Ridges.h +++ b/Ridges_3/include/CGAL/Ridges.h @@ -190,10 +190,10 @@ class Ridge_approximation //requirements for the templates TriangleMesh and VertexFTMap or VertexVectorMap - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); typedef std::pair< halfedge_descriptor, FT> Ridge_halfedge; typedef Ridge_halfedge Ridge_halfhedge; // kept for backward compatibility diff --git a/Ridges_3/include/CGAL/Umbilics.h b/Ridges_3/include/CGAL/Umbilics.h index 945fb986ae7..f815b9c18ca 100644 --- a/Ridges_3/include/CGAL/Umbilics.h +++ b/Ridges_3/include/CGAL/Umbilics.h @@ -110,10 +110,10 @@ class Umbilic_approximation typedef typename boost::graph_traits::vertex_iterator Vertex_const_iterator; //requirements for the templates TriangleMesh and VertexFTMap or VertexVectorMap - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); + static_assert(std::is_same::value); typedef CGAL::Umbilic Umbilic; diff --git a/STL_Extension/include/CGAL/Handle_with_policy.h b/STL_Extension/include/CGAL/Handle_with_policy.h index 004c8b4d96f..5f952a66e15 100644 --- a/STL_Extension/include/CGAL/Handle_with_policy.h +++ b/STL_Extension/include/CGAL/Handle_with_policy.h @@ -355,8 +355,8 @@ namespace Intern { typedef ::CGAL::Reference_counted_hierarchy_with_union Reference_counted_hierarchy_with_union; CGAL_USE_TYPE(Reference_counted_hierarchy_with_union); - CGAL_static_assertion(( - ::CGAL::is_same_or_derived< Reference_counted_hierarchy_with_union, T >::value )); + static_assert( + ::CGAL::is_same_or_derived< Reference_counted_hierarchy_with_union, T >::value ); } typedef T Rep; }; @@ -760,7 +760,7 @@ private: static Rep_allocator allocator; static Rep* new_rep( const Rep& rep) { - CGAL_static_assertion( !( + static_assert( !( ::CGAL::is_same_or_derived< Reference_counted_hierarchy_base, Handled_type >::value )); Rep* p = allocator.allocate(1); std::allocator_traits::construct(allocator, p, rep); @@ -855,8 +855,8 @@ protected: //! argument, and the single argument template constructor no other //! constructor will work for class hierarchies of representations. Handle_with_policy( Rep* p) : ptr_( p) { - CGAL_static_assertion(( - ::CGAL::is_same_or_derived< Reference_counted_hierarchy_base, Handled_type >::value )); + static_assert( + ::CGAL::is_same_or_derived< Reference_counted_hierarchy_base, Handled_type >::value ); //Bind bind_; // trigger compile-time check //(void)bind_; (void)Bind(); @@ -869,8 +869,8 @@ protected: //! version of \c initialize_with is applicable in this case except //! the template version with one argument. void initialize_with( Rep* p) { - CGAL_static_assertion(( - ::CGAL::is_same_or_derived< Reference_counted_hierarchy_base, Handled_type >::value )); + static_assert( + ::CGAL::is_same_or_derived< Reference_counted_hierarchy_base, Handled_type >::value ); //Bind bind_; // trigger compile-time check //(void)bind_; (void)Bind(); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 1daa82ed9e8..d0f1648f816 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -182,7 +182,7 @@ typename Get_param, Query_tag>::type get_parameter_impl(const Named_params_impl& np, Query_tag tag) { #ifndef CGAL_NO_STATIC_ASSERTION_TEST - CGAL_static_assertion( (!std::is_same::value) ); + static_assert(!std::is_same::value); #endif return get_parameter_impl(static_cast(np), tag); } @@ -243,7 +243,7 @@ template typename Get_param, Query_tag>::reference get_parameter_reference_impl(const Named_params_impl& np, Query_tag tag) { - CGAL_static_assertion( (!std::is_same::value) ); + static_assert(!std::is_same::value); return get_parameter_reference_impl(static_cast(np), tag); } @@ -569,7 +569,7 @@ namespace boost template void get_param(CGAL::Named_function_parameters, Tag2) { - CGAL_static_assertion(B && "You must use CGAL::parameters::get_parameter instead of boost::get_param"); + static_assert(B && "You must use CGAL::parameters::get_parameter instead of boost::get_param"); } } #endif @@ -577,6 +577,6 @@ namespace boost // For disambiguation using SFINAE BOOST_MPL_HAS_XXX_TRAIT_DEF(CGAL_Named_function_parameters_class) template -CGAL_CPP17_INLINE constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class::value; +inline constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class::value; #endif // CGAL_BOOST_FUNCTION_PARAMS_HPP diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 32d7524f7b2..cf793f466be 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -137,12 +137,6 @@ inline bool possibly(Uncertain c); # define CGAL_unreachable() CGAL_assertion(false) # endif // CGAL_UNREACHABLE -# define CGAL_static_assertion(EX) \ - static_assert(EX, #EX) - -# define CGAL_static_assertion_msg(EX,MSG) \ - static_assert(EX, MSG) - #if defined(CGAL_NO_ASSERTIONS) || !defined(CGAL_CHECK_EXACTNESS) # define CGAL_exactness_assertion(EX) (static_cast(0)) # define CGAL_exactness_assertion_msg(EX,MSG) (static_cast(0)) diff --git a/STL_Extension/include/CGAL/for_each.h b/STL_Extension/include/CGAL/for_each.h index 8f05752cbf2..663f62440b4 100644 --- a/STL_Extension/include/CGAL/for_each.h +++ b/STL_Extension/include/CGAL/for_each.h @@ -102,8 +102,8 @@ void for_each (const Range& range, ::reference)>& functor) { #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #endif internal::for_each @@ -118,8 +118,8 @@ void for_each (Range& range, ::reference)>& functor) { #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #endif internal::for_each diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 22cead434c7..0ac9fcf11ae 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1340,7 +1340,7 @@ class Dispatch_output_iterator < std::tuple, std::tuple > : private internal::Derivator, std::tuple >, std::tuple, std::tuple > , public std::tuple { - CGAL_static_assertion_msg(sizeof...(V) == sizeof...(O), + static_assert(sizeof...(V) == sizeof...(O), "The number of explicit template parameters has to match the number of arguments"); static const int size = sizeof...(V); diff --git a/STL_Extension/include/CGAL/transforming_pair_iterator.h b/STL_Extension/include/CGAL/transforming_pair_iterator.h index d048850c156..421e9f8ebb8 100644 --- a/STL_Extension/include/CGAL/transforming_pair_iterator.h +++ b/STL_Extension/include/CGAL/transforming_pair_iterator.h @@ -21,7 +21,7 @@ namespace CGAL { namespace internal { template ::value> struct Min_category { - CGAL_static_assertion((std::is_convertible::value)); + static_assert(std::is_convertible::value); typedef Cat1 type; }; diff --git a/STL_Extension/include/CGAL/type_traits/is_iterator.h b/STL_Extension/include/CGAL/type_traits/is_iterator.h index e48f3ef8bf1..6630dd8ceb1 100644 --- a/STL_Extension/include/CGAL/type_traits/is_iterator.h +++ b/STL_Extension/include/CGAL/type_traits/is_iterator.h @@ -65,7 +65,7 @@ struct is_iterator { }; template -CGAL_CPP17_INLINE constexpr bool is_iterator_v = is_iterator::value; +inline constexpr bool is_iterator_v = is_iterator::value; template struct is_iterator_type @@ -73,7 +73,7 @@ struct is_iterator_type { }; template -CGAL_CPP17_INLINE constexpr bool is_iterator_type_v = is_iterator_type::value; +inline constexpr bool is_iterator_type_v = is_iterator_type::value; template ::value> @@ -87,7 +87,7 @@ struct is_iterator_to { }; template -CGAL_CPP17_INLINE constexpr bool is_iterator_to_v = is_iterator_to::value; +inline constexpr bool is_iterator_to_v = is_iterator_to::value; } // namespace CGAL diff --git a/STL_Extension/test/STL_Extension/test_Cache.cpp b/STL_Extension/test/STL_Extension/test_Cache.cpp index a5c9de6e5a3..fc645fe5be0 100644 --- a/STL_Extension/test/STL_Extension/test_Cache.cpp +++ b/STL_Extension/test/STL_Extension/test_Cache.cpp @@ -57,16 +57,16 @@ struct Int_t : public CGAL::Handle_with_policy< Int_rep, Unify > { void test_typedefs(){ typedef CGAL::Cache Cache; CGAL_USE_TYPE(Cache); - CGAL_static_assertion(( ::std::is_same< Cache::Input, int >::value )); - CGAL_static_assertion(( ::std::is_same< Cache::Output,double>::value )); + static_assert(::std::is_same< Cache::Input, int >::value ); + static_assert(::std::is_same< Cache::Output,double>::value ); typedef CGAL::Creator_1 Creator_double; CGAL_USE_TYPE(Creator_double); - CGAL_static_assertion(( ::std::is_same::value )); + static_assert(::std::is_same::value ); typedef CGAL::Creator_1 Creator_int; CGAL_USE_TYPE(Creator_int); - CGAL_static_assertion(( ::std::is_same::value )); - CGAL_static_assertion(( ::std::is_same >::value )); - CGAL_static_assertion(( ::std::is_same >::value )); + static_assert(::std::is_same::value ); + static_assert(::std::is_same >::value ); + static_assert(::std::is_same >::value ); } int main(){ { diff --git a/STL_Extension/test/STL_Extension/test_Compact_container.cpp b/STL_Extension/test/STL_Extension/test_Compact_container.cpp index 36007338112..60aa43db0e2 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container.cpp @@ -344,7 +344,7 @@ int main() } // Check that Compact_container does not require a complete type. - CGAL_static_assertion(sizeof(CGAL::Compact_container) > 0); + static_assert(sizeof(CGAL::Compact_container) > 0); // Test increment policy CGAL::Compact_container > C5; diff --git a/STL_Extension/test/STL_Extension/test_cgal_named_params.cpp b/STL_Extension/test/STL_Extension/test_cgal_named_params.cpp index 2ae445fbfd5..c5fba6ce23b 100644 --- a/STL_Extension/test/STL_Extension/test_cgal_named_params.cpp +++ b/STL_Extension/test/STL_Extension/test_cgal_named_params.cpp @@ -24,7 +24,7 @@ template void check_same_type(T) { static const bool b = std::is_same< A, T >::value; - CGAL_static_assertion(b); + static_assert(b); assert(b); } @@ -46,7 +46,7 @@ template void test_no_copyable(const NamedParameters& np) { typedef typename inp::Get_param::type NP_type; - CGAL_static_assertion( (std::is_same >::value) ); + static_assert(std::is_same >::value); const A<4>& a = params::choose_parameter(params::get_parameter_reference(np, inp::edge_index), A<4>(4)); assert(a.v==4); @@ -60,31 +60,31 @@ void test_references(const NamedParameters& np) // std::reference_wrapper typedef typename inp::Lookup_named_param_def::reference Visitor_reference_type; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); Visitor_reference_type vis_ref = params::choose_parameter(params::get_parameter_reference(np, inp::visitor), default_value); CGAL_USE(vis_ref); // std::reference_wrapper of const typedef typename inp::Lookup_named_param_def::reference FIM_reference_type; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); FIM_reference_type fim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::face_index), default_value); CGAL_USE(fim_ref); // non-copyable typedef typename inp::Lookup_named_param_def::reference VPM_reference_type; - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); VPM_reference_type vpm_ref = params::choose_parameter(params::get_parameter_reference(np, inp::vertex_point), default_value); CGAL_USE(vpm_ref); // passed by copy typedef typename inp::Lookup_named_param_def::reference VIM_reference_type; - CGAL_static_assertion( (std::is_same, VIM_reference_type>::value) ); + static_assert(std::is_same, VIM_reference_type>::value); VIM_reference_type vim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::vertex_index), default_value); CGAL_USE(vim_ref); // default typedef typename inp::Lookup_named_param_def::reference EIM_reference_type; - CGAL_static_assertion(( std::is_same::value) ); + static_assert(std::is_same::value); EIM_reference_type eim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::edge_index), default_value); assert(&eim_ref==&default_value); } @@ -103,12 +103,12 @@ int main() ); auto d = CGAL::parameters::default_values(); - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); #ifndef CGAL_NO_DEPRECATED_CODE auto d1 = CGAL::parameters::all_default(); - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); auto d2 = CGAL::Polygon_mesh_processing::parameters::all_default(); - CGAL_static_assertion( (std::is_same::value) ); + static_assert(std::is_same::value); #endif return EXIT_SUCCESS; diff --git a/STL_Extension/test/STL_Extension/test_is_iterator.cpp b/STL_Extension/test/STL_Extension/test_is_iterator.cpp index 7305fe62da0..f308d9b4880 100644 --- a/STL_Extension/test/STL_Extension/test_is_iterator.cpp +++ b/STL_Extension/test/STL_Extension/test_is_iterator.cpp @@ -17,17 +17,17 @@ int main() { CGAL_USE_TYPE(vector_it); CGAL_USE_TYPE(list_it); CGAL_USE_TYPE(int_p); - CGAL_static_assertion(is_iterator::value); - CGAL_static_assertion(is_iterator::value); - CGAL_static_assertion(!is_iterator::value); - CGAL_static_assertion(!is_iterator::value); - CGAL_static_assertion(is_iterator::value); + static_assert(is_iterator::value); + static_assert(is_iterator::value); + static_assert(!is_iterator::value); + static_assert(!is_iterator::value); + static_assert(is_iterator::value); - CGAL_static_assertion((is_iterator_type::value)); - CGAL_static_assertion((!is_iterator_type::value)); - CGAL_static_assertion((!is_iterator_type::value)); + static_assert(is_iterator_type::value); + static_assert(!is_iterator_type::value); + static_assert(!is_iterator_type::value); - CGAL_static_assertion((is_iterator_to::value)); - CGAL_static_assertion((!is_iterator_to::value)); - CGAL_static_assertion((!is_iterator_to::value)); + static_assert(is_iterator_to::value); + static_assert(!is_iterator_to::value); + static_assert(!is_iterator_to::value); } diff --git a/STL_Extension/test/STL_Extension/test_is_streamable.cpp b/STL_Extension/test/STL_Extension/test_is_streamable.cpp index 7d1c81a892c..fc248fc7e6e 100644 --- a/STL_Extension/test/STL_Extension/test_is_streamable.cpp +++ b/STL_Extension/test/STL_Extension/test_is_streamable.cpp @@ -21,12 +21,12 @@ istream& operator>>(istream& is, const D&) { return is; } int main() { using CGAL::is_streamable; - CGAL_static_assertion(!is_streamable::value); - CGAL_static_assertion(is_streamable::value); - CGAL_static_assertion(!is_streamable::value); - CGAL_static_assertion(!is_streamable::value); - CGAL_static_assertion(is_streamable::value); - CGAL_static_assertion(is_streamable::value); - CGAL_static_assertion(! (is_streamable >::value) ); - CGAL_static_assertion( (is_streamable >::value) ); + static_assert(!is_streamable::value); + static_assert(is_streamable::value); + static_assert(!is_streamable::value); + static_assert(!is_streamable::value); + static_assert(is_streamable::value); + static_assert(is_streamable::value); + static_assert(!is_streamable >::value); + static_assert(is_streamable >::value); } diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index d361ed8b610..29e078c46c7 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -8117,10 +8117,10 @@ void test_tuple(){ CGAL_USE_TYPE(T0); CGAL_USE_TYPE(T2); - CGAL_static_assertion( std::tuple_size::value == 0 ); - CGAL_static_assertion( std::tuple_size::value == 2 ); - CGAL_static_assertion( std::tuple_size::value == 4 ); - CGAL_static_assertion( (std::is_same::type,My_to_int>::value) ); + static_assert( std::tuple_size::value == 0 ); + static_assert( std::tuple_size::value == 2 ); + static_assert( std::tuple_size::value == 4 ); + static_assert( std::is_same::type,My_to_int>::value ); T1 t1=std::make_tuple(1,2); T1 t1_2=std::make_tuple(1,2); @@ -8206,17 +8206,17 @@ void test_make_sorted_pair() { assert(p3==p4); int i=2; assert( CGAL::make_sorted_pair(1,i) == std::make_pair(1,i) ); - CGAL_static_assertion( (std::is_same< + static_assert( std::is_same< BOOST_TYPEOF(CGAL::make_sorted_pair(1L,i)), - std::pair >::value) ); + std::pair >::value); assert( (CGAL::make_sorted_pair(i,1L) == std::pair(1L,2L)) ); - CGAL_static_assertion( (std::is_same< + static_assert( std::is_same< BOOST_TYPEOF(CGAL::make_sorted_pair(1,2L)), - std::pair >::value) ); - CGAL_static_assertion( (std::is_same< + std::pair >::value) ; + static_assert( std::is_same< BOOST_TYPEOF(CGAL::make_sorted_pair(1,2L)), - std::pair >::value) ); + std::pair >::value); } void test_result_of() { @@ -8237,8 +8237,8 @@ void test_result_of() { typedef CGAL::cpp11::result_of::type result_type_float; CGAL_USE_TYPE(result_type); CGAL_USE_TYPE(result_type_float); - CGAL_static_assertion((std::is_same::value)); - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); + static_assert(std::is_same::value); } diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h index cecf6f62d44..af9cda15c2d 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h @@ -198,7 +198,7 @@ private: void try_parallel (const F& func, std::size_t begin, std::size_t end) { #ifndef CGAL_LINKED_WITH_TBB - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #else if (std::is_convertible::value) diff --git a/Scripts/developer_scripts/autotest_cgal b/Scripts/developer_scripts/autotest_cgal index ab124cf51e2..c984ac9ae23 100755 --- a/Scripts/developer_scripts/autotest_cgal +++ b/Scripts/developer_scripts/autotest_cgal @@ -429,6 +429,13 @@ setup_dirs() for PLATFORM in ${PLATFORMS}; do + # MSVC2015 does not support C++17 + if [ "$CGAL_RELEASE_ID" \> "CGAL-6.0" ]; then + if [ "$PLATFORMS" = "MSVC2015-Release-64bits" ]; then + continue + fi + fi + CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} if [ ! -d "${CGAL_BINARY_DIR}" ]; then diff --git a/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h b/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h index 94713899f34..b86325e6d39 100644 --- a/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h +++ b/Shape_regularization/include/CGAL/Shape_regularization/regularize_planes.h @@ -296,7 +296,7 @@ namespace Planes { using PlaneIndexMap = typename CGAL::Point_set_processing_3::GetPlaneIndexMap::type; - CGAL_static_assertion_msg((!is_default_parameter::value), + static_assert(!is_default_parameter::value, "Error: no plane index map"); const PlaneIndexMap index_map = diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h index 3709e0a0e15..a070f1522d3 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h @@ -105,7 +105,7 @@ public: template class Multiple_kd_tree { - CGAL_static_assertion_msg((std::is_pointer::value), "SAVED_OBJECT is not a pointer."); + static_assert(std::is_pointer::value, "SAVED_OBJECT is not a pointer."); private: typedef Traits_ Traits; typedef typename Traits::FT NT; diff --git a/Spatial_searching/include/CGAL/Kd_tree.h b/Spatial_searching/include/CGAL/Kd_tree.h index c3e107bc31f..4ee61cb9214 100644 --- a/Spatial_searching/include/CGAL/Kd_tree.h +++ b/Spatial_searching/include/CGAL/Kd_tree.h @@ -335,7 +335,7 @@ public: } #ifndef CGAL_TBB_STRUCTURE_IN_KD_TREE - CGAL_static_assertion_msg (!(std::is_convertible::value), + static_assert (!(std::is_convertible::value), "Parallel_tag is enabled but TBB is unavailable."); #endif diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h index aaff07b8693..1f1cedc6eb3 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h @@ -155,8 +155,8 @@ public: #ifndef CGAL_LINKED_WITH_TBB CGAL_USE(begin); CGAL_USE(end); - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #else const int y = (x + 1) % 2; if (std::distance(begin,end) <= _limit) diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h index d318d436921..3fb4a3120ae 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h @@ -178,8 +178,8 @@ public: #ifndef CGAL_LINKED_WITH_TBB CGAL_USE(begin); CGAL_USE(end); - CGAL_static_assertion_msg (!(std::is_convertible::value), - "Parallel_tag is enabled but TBB is unavailable."); + static_assert (!std::is_convertible::value, + "Parallel_tag is enabled but TBB is unavailable."); #else const int y = (x + 1) % 3, z = (x + 2) % 3; if ((end - begin) <= _limit) return; diff --git a/Stream_support/include/CGAL/IO/helpers.h b/Stream_support/include/CGAL/IO/helpers.h index 39828dcabe2..bba12aa85a7 100644 --- a/Stream_support/include/CGAL/IO/helpers.h +++ b/Stream_support/include/CGAL/IO/helpers.h @@ -84,7 +84,7 @@ struct is_Range { }; template -CGAL_CPP17_INLINE constexpr bool is_Range_v = is_Range::value; +inline constexpr bool is_Range_v = is_Range::value; // For polygon meshes template @@ -93,7 +93,7 @@ struct is_Point_set_or_Range_or_Iterator { }; template -CGAL_CPP17_INLINE constexpr bool is_Point_set_or_Range_or_Iterator_v = is_Point_set_or_Range_or_Iterator::value; +inline constexpr bool is_Point_set_or_Range_or_Iterator_v = is_Point_set_or_Range_or_Iterator::value; } // end namespace internal } // end namespace IO diff --git a/Stream_support/test/Stream_support/test_ioformat.cpp b/Stream_support/test/Stream_support/test_ioformat.cpp index e4e4e13e67e..d85c7c0577c 100644 --- a/Stream_support/test/Stream_support/test_ioformat.cpp +++ b/Stream_support/test/Stream_support/test_ioformat.cpp @@ -50,8 +50,8 @@ void test_io(const NT& x){ } int main() { - CGAL_static_assertion(CGAL::Output_rep::is_specialized == false); - CGAL_static_assertion(CGAL::Input_rep::is_specialized == false); + static_assert(CGAL::Output_rep::is_specialized == false); + static_assert(CGAL::Input_rep::is_specialized == false); std::cout << "test_io: short "<< std::endl; test_io(12); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 7a281a09f78..485da4c6975 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -176,7 +176,7 @@ public: Two_vertices_parameterizer_3 >::type Border_parameterizer; #if !defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg(!(std::is_same::value), + static_assert(!(std::is_same::value), "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); #endif diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index 015e61348b8..d32929793c3 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -104,7 +104,7 @@ public: Circular_border_arc_length_parameterizer_3 >::type Border_parameterizer; #if !defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg(!(std::is_same::value), + static_assert(!(std::is_same::value), "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); #endif diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index f021adbbc90..252f0864a1e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -383,7 +383,7 @@ class Orbifold_Tutte_parameterizer_3 public: #ifndef DOXYGEN_RUNNING #if !defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg(!(std::is_same::value), + static_assert(!(std::is_same::value), "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); #endif diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h index 59a33fa465c..04303b90353 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_distance_placement.h @@ -49,7 +49,7 @@ private: template void initialize_tree(const Profile& profile) const { - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); typedef typename Profile::Triangle_mesh Triangle_mesh; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h index 28b22b3e079..86fd7c87544 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/FastEnvelope_filter.h @@ -43,7 +43,7 @@ private: template void initialize_envelope(const Profile& profile) const { - CGAL_static_assertion((std::is_same::value)); + static_assert(std::is_same::value); typedef typename Profile::Triangle_mesh Triangle_mesh; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Combining_oracle.h b/Surface_mesher/include/CGAL/Surface_mesher/Combining_oracle.h index 46c1a253cc4..2541ef6ff30 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Combining_oracle.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Combining_oracle.h @@ -51,9 +51,9 @@ namespace CGAL { typedef typename Oracle_a::Intersection_point Intersection_point; - CGAL_static_assertion((::std::is_same< + static_assert(::std::is_same< Intersection_point, - typename Oracle_b::Intersection_point>::value)); + typename Oracle_b::Intersection_point>::value); typedef ::CGAL::Multi_surface_3::value)); + static_assert(Arr_sane_identified_tagging< Left_side_category, Bottom_side_category, + Top_side_category, Right_side_category >::value); protected: /*! diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index b47f2971231..6f63f08162d 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -130,7 +130,7 @@ public: >::type Cell_range; # else - CGAL_static_assertion_msg + static_assert (!(std::is_convertible::value), "In CGAL triangulations, `Parallel_tag` can only be used with the Intel TBB library. " "Make TBB available in the build system and then define the macro `CGAL_LINKED_WITH_TBB`."); diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index f22b9be5f52..ca65c413f3c 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -187,11 +187,11 @@ public: //! If the diagonal's length has never been computed, computes it and //! saves the result for further calls. //! @returns the item's bounding box's diagonal length. - virtual double diagonalBbox() const { - if(!is_diag_bbox_computed) - compute_diag_bbox(); - is_diag_bbox_computed = true; - return _diag_bbox; + virtual double bboxDiagonal() const { + if(!is_bbox_diag_computed) + compute_diag_bbox(); + is_bbox_diag_computed = true; + return _diag_bbox; } // Function about manipulation @@ -413,7 +413,7 @@ protected: mutable Bbox _bbox; mutable double _diag_bbox; mutable bool is_bbox_computed; - mutable bool is_diag_bbox_computed; + mutable bool is_bbox_diag_computed; virtual void compute_bbox()const{} virtual void compute_diag_bbox()const; // The four basic properties diff --git a/Three/include/CGAL/Three/Scene_item_rendering_helper.h b/Three/include/CGAL/Three/Scene_item_rendering_helper.h index f654139c2a6..72fd4ce154a 100644 --- a/Three/include/CGAL/Three/Scene_item_rendering_helper.h +++ b/Three/include/CGAL/Three/Scene_item_rendering_helper.h @@ -174,7 +174,7 @@ public: //! saves the result for further calls. //! @returns the item's bounding box's diagonal length. //! @todo must replace the one from Scene_item eventually - virtual double diagonalBbox() const Q_DECL_OVERRIDE; + virtual double bboxDiagonal() const Q_DECL_OVERRIDE; //! //! \brief newViewer adds Vaos for `viewer`. //! \param viewer the new viewer. diff --git a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h index 41a72c1e9de..86d9a71f51e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h @@ -31,7 +31,7 @@ namespace CGAL { std::map* aface_to_dart=nullptr) { - CGAL_static_assertion( LCC::dimension>=2 && LCC::ambient_dimension==2 ); + static_assert( LCC::dimension>=2 && LCC::ambient_dimension==2 ); // Case of empty triangulations. if (atr.number_of_vertices()==0) return LCC::null_descriptor; diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 01a5dbb8535..14f718f0b13 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -49,7 +49,7 @@ namespace CGAL { std::map* avol_to_dart=nullptr) { - CGAL_static_assertion( LCC::dimension>=3 && LCC::ambient_dimension==3 ); + static_assert( LCC::dimension>=3 && LCC::ambient_dimension==3 ); // Case of empty triangulations. if (atr.number_of_vertices() == 0) return LCC::null_descriptor; diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h index b235ad31d47..c6751c2a3cb 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h @@ -631,8 +631,8 @@ insert(InputIterator first, InputIterator beyond, { typedef Point_3_with_iterator P3_wit; - CGAL_static_assertion((std::is_same::value_type, Point>::value)); - CGAL_static_assertion(!(std::is_same::value)); + static_assert(std::is_same::value_type, Point>::value); + static_assert(!std::is_same::value); const size_type n = number_of_vertices(); diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h index fbe52979939..98dc2f54c65 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h @@ -56,7 +56,7 @@ double get_theta(typename Kernel::Point_3& pt, #endif >::type Col; - CGAL_static_assertion_msg(!(std::is_same::value), + static_assert(!(std::is_same::value), "Eigen is required to perform arc subsampling!"); auto V1c = V1.cartesian_begin(), V2c = V2.cartesian_begin(), V3c = V3.cartesian_begin();