use CGAL_static_assertion

static_assert(b) is only available in c++17
This commit is contained in:
Sébastien Loriot 2022-06-10 10:10:12 +02:00
parent 27514ed036
commit 8ed2990381
9 changed files with 52 additions and 52 deletions

View File

@ -90,10 +90,10 @@ public:
typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Top_side_category Top_side_category;
typedef typename Gt_adaptor_2::Right_side_category Right_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category;
static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value); CGAL_static_assertion(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value);
static_assert(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value); CGAL_static_assertion(std::is_same< Bottom_side_category, Arr_oblivious_side_tag >::value);
static_assert(std::is_same< Top_side_category, Arr_oblivious_side_tag >::value); CGAL_static_assertion(std::is_same< Top_side_category, Arr_oblivious_side_tag >::value);
static_assert(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value); CGAL_static_assertion(std::is_same< Right_side_category, Arr_oblivious_side_tag >::value);
//@} //@}
/*! \struct /*! \struct

View File

@ -91,13 +91,13 @@ public:
typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Top_side_category Top_side_category;
typedef typename Gt_adaptor_2::Right_side_category Right_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category;
static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || 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); std::is_same< Left_side_category, Arr_identified_side_tag >::value);
static_assert(std::is_same< Bottom_side_category, Arr_oblivious_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); std::is_same< Bottom_side_category, Arr_contracted_side_tag >::value);
static_assert(std::is_same< Top_side_category, Arr_oblivious_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); std::is_same< Top_side_category, Arr_contracted_side_tag >::value);
static_assert(std::is_same< Right_side_category, Arr_oblivious_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); std::is_same< Right_side_category, Arr_identified_side_tag >::value);
//@} //@}

View File

@ -87,13 +87,13 @@ public:
typedef typename Gt_adaptor_2::Top_side_category Top_side_category; typedef typename Gt_adaptor_2::Top_side_category Top_side_category;
typedef typename Gt_adaptor_2::Right_side_category Right_side_category; typedef typename Gt_adaptor_2::Right_side_category Right_side_category;
static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || 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); std::is_same< Left_side_category, Arr_open_side_tag >::value);
static_assert(std::is_same< Bottom_side_category, Arr_oblivious_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); std::is_same< Bottom_side_category, Arr_open_side_tag >::value);
static_assert(std::is_same< Top_side_category, Arr_oblivious_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); std::is_same< Top_side_category, Arr_open_side_tag >::value);
static_assert(std::is_same< Right_side_category, Arr_oblivious_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); std::is_same< Right_side_category, Arr_open_side_tag >::value);
//@} //@}

View File

@ -79,7 +79,7 @@ public:
typedef typename Traits_adaptor_2::Top_side_category Top_side_category; typedef typename Traits_adaptor_2::Top_side_category Top_side_category;
typedef typename Traits_adaptor_2::Right_side_category Right_side_category; typedef typename Traits_adaptor_2::Right_side_category Right_side_category;
static_assert(Arr_sane_identified_tagging<Left_side_category, CGAL_static_assertion(Arr_sane_identified_tagging<Left_side_category,
Bottom_side_category, Bottom_side_category,
Top_side_category, Top_side_category,
Right_side_category>::value); Right_side_category>::value);

View File

@ -67,7 +67,7 @@ protected:
typedef typename Traits_adaptor_2::Top_side_category Top_side_category; typedef typename Traits_adaptor_2::Top_side_category Top_side_category;
typedef typename Traits_adaptor_2::Right_side_category Right_side_category; typedef typename Traits_adaptor_2::Right_side_category Right_side_category;
static_assert(Arr_sane_identified_tagging<Left_side_category, CGAL_static_assertion(Arr_sane_identified_tagging<Left_side_category,
Bottom_side_category, Bottom_side_category,
Top_side_category, Top_side_category,
Right_side_category>::value); Right_side_category>::value);

View File

@ -123,13 +123,13 @@ public:
typedef typename Arr::Right_side_category Right_side_category; typedef typename Arr::Right_side_category Right_side_category;
// a side is either oblivious or open (unbounded) // a side is either oblivious or open (unbounded)
static_assert(std::is_same<Left_side_category, Arr_oblivious_side_tag>::value || 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); std::is_same<Left_side_category, Arr_open_side_tag>::value);
static_assert(std::is_same<Bottom_side_category, Arr_oblivious_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); std::is_same<Bottom_side_category, Arr_open_side_tag>::value);
static_assert(std::is_same<Top_side_category, Arr_oblivious_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); std::is_same<Top_side_category, Arr_open_side_tag> >::value);
static_assert(std::is_same<Right_side_category, Arr_oblivious_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); std::is_same<Right_side_category, Arr_open_side_tag>::value);
typedef typename Arr::Halfedge_handle Halfedge_handle; typedef typename Arr::Halfedge_handle Halfedge_handle;

View File

@ -53,13 +53,13 @@ public:
typedef typename Base::Right_side_category Right_side_category; typedef typename Base::Right_side_category Right_side_category;
// a side is either oblivious or open (unbounded) // a side is either oblivious or open (unbounded)
static_assert(std::is_same< Left_side_category, Arr_oblivious_side_tag >::value || 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); std::is_same< Left_side_category, Arr_open_side_tag >::value);
static_assert(std::is_same< Bottom_side_category, Arr_oblivious_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); std::is_same< Bottom_side_category, Arr_open_side_tag >::value);
static_assert(std::is_same< Top_side_category, Arr_oblivious_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); std::is_same< Top_side_category, Arr_open_side_tag > >::value);
static_assert(std::is_same< Right_side_category, Arr_oblivious_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); std::is_same< Right_side_category, Arr_open_side_tag > >::value);
class Ex_point_2 class Ex_point_2

View File

@ -10,14 +10,14 @@ using CGAL::Tag_true;
using CGAL::Tag_false; using CGAL::Tag_false;
int main() { int main() {
static_assert(is_same< Tag_true::value_type, bool >::value); CGAL_static_assertion(is_same< Tag_true::value_type, bool >::value);
static_assert(is_same< Tag_true::type, Tag_true >::value); CGAL_static_assertion(is_same< Tag_true::type, Tag_true >::value);
static_assert(Tag_true::value== true); CGAL_static_assertion(Tag_true::value== true);
assert( Tag_true() == true ); assert( Tag_true() == true );
static_assert(is_same< Tag_false::value_type, bool >::value); CGAL_static_assertion(is_same< Tag_false::value_type, bool >::value);
static_assert(is_same< Tag_false::type, Tag_false >::value); CGAL_static_assertion(is_same< Tag_false::type, Tag_false >::value);
static_assert(Tag_false::value == false); CGAL_static_assertion(Tag_false::value == false);
assert( Tag_false() == false ); assert( Tag_false() == false );
return 0; return 0;

View File

@ -129,7 +129,7 @@ public:
typedef typename Traits_adaptor_2::Top_side_category Top_side_category; typedef typename Traits_adaptor_2::Top_side_category Top_side_category;
typedef typename Traits_adaptor_2::Right_side_category Right_side_category; typedef typename Traits_adaptor_2::Right_side_category Right_side_category;
static_assert(Arr_sane_identified_tagging< Left_side_category, Bottom_side_category, CGAL_static_assertion(Arr_sane_identified_tagging< Left_side_category, Bottom_side_category,
Top_side_category, Right_side_category >::value); Top_side_category, Right_side_category >::value);
protected: protected: