mirror of https://github.com/CGAL/cgal
use CGAL_static_assertion
static_assert(b) is only available in c++17
This commit is contained in:
parent
27514ed036
commit
8ed2990381
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,14 @@ 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);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/*! \struct
|
/*! \struct
|
||||||
|
|
|
||||||
|
|
@ -87,14 +87,14 @@ 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);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/*! \struct
|
/*! \struct
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,10 @@ 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);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Arrangement_on_surface_2<Geometry_traits_2, Topology_traits>
|
typedef Arrangement_on_surface_2<Geometry_traits_2, Topology_traits>
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,10 @@ 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);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef ZoneVisitor_ Visitor;
|
typedef ZoneVisitor_ Visitor;
|
||||||
|
|
|
||||||
|
|
@ -123,14 +123,14 @@ 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;
|
||||||
typedef typename Arr::Vertex_handle Vertex_handle;
|
typedef typename Arr::Vertex_handle Vertex_handle;
|
||||||
|
|
|
||||||
|
|
@ -53,14 +53,14 @@ 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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,8 @@ 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:
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue