diff --git a/NewKernel_d/include/CGAL/Epick_d.h b/NewKernel_d/include/CGAL/Epick_d.h index 1f54fe65f73..9052004009e 100644 --- a/NewKernel_d/include/CGAL/Epick_d.h +++ b/NewKernel_d/include/CGAL/Epick_d.h @@ -10,21 +10,44 @@ namespace CGAL { -template -struct Epick_d_help1 -: Cartesian_filter_K< - Cartesian_base_d >, - Cartesian_base_d >, - Cartesian_base_d > +#define CGAL_BASE \ + Cartesian_filter_K< \ + Cartesian_base_d, \ + Cartesian_base_d, \ + Cartesian_base_d \ > -{}; -template +template +struct Epick_d_help1 +: CGAL_BASE +{ + CGAL_CONSTEXPR Epick_d_help1(){} + CGAL_CONSTEXPR Epick_d_help1(int d):CGAL_BASE(d){} +}; +#undef CGAL_BASE +#define CGAL_BASE \ + Cartesian_static_filters,Epick_d_help2 > +template struct Epick_d_help2 -: Cartesian_static_filters,Epick_d_help1,Epick_d_help2 > -{}; +: CGAL_BASE +{ + CGAL_CONSTEXPR Epick_d_help2(){} + CGAL_CONSTEXPR Epick_d_help2(int d):CGAL_BASE(d){} +}; +#undef CGAL_BASE +#define CGAL_BASE \ + Kernel_d_interface< Cartesian_wrap< Epick_d_help2< \ + typename boost::conditional< d_==UNKNOWN_DIMENSION, \ + Dynamic_dimension_tag, \ + Dimension_tag \ + >::type \ + > > > template struct Epick_d -: Kernel_d_interface > > -{}; +: CGAL_BASE +{ + CGAL_CONSTEXPR Epick_d(){} + CGAL_CONSTEXPR Epick_d(int d):CGAL_BASE(d){} +}; +#undef CGAL_BASE } #endif diff --git a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_base.h b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_base.h index 8060a39222b..f97e6e015d3 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_base.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_base.h @@ -6,24 +6,25 @@ #include namespace CGAL { - -template < typename FT_, typename Dim_, typename Derived_=Default> -struct Cartesian_base_d : public -Cartesian_complete_predicates< -Cartesian_complete_constructors< -Cartesian_complete_computes< -Cartesian_complete_types< -Cartesian_LA_base_d< - FT_, Dim_ ->, false, typename Default::Get >::type ->, false, typename Default::Get >::type ->, false, typename Default::Get >::type ->, false, typename Default::Get >::type +#define CGAL_BASE \ +Cartesian_complete_predicates< \ +Cartesian_complete_constructors< \ +Cartesian_complete_computes< \ +Cartesian_complete_types< \ +Cartesian_LA_base_d< \ + FT_, Dim_ \ +>, false, typename Default::Get >::type \ +>, false, typename Default::Get >::type \ +>, false, typename Default::Get >::type \ +>, false, typename Default::Get >::type \ > +template < typename FT_, typename Dim_, typename Derived_=Default> +struct Cartesian_base_d : public CGAL_BASE { CGAL_CONSTEXPR Cartesian_base_d(){} - CGAL_CONSTEXPR Cartesian_base_d(int d):Dimension_base(d){} + CGAL_CONSTEXPR Cartesian_base_d(int d):CGAL_BASE(d){} }; +#undef CGAL_BASE } //namespace CGAL diff --git a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_complete.h b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_complete.h index d9f6d3e5877..a81f7ed3bca 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_complete.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_complete.h @@ -49,6 +49,9 @@ template struct Cartesian_define_all_functors template struct Cartesian_complete_types : public R_ { + CGAL_CONSTEXPR Cartesian_complete_types(){} + CGAL_CONSTEXPR Cartesian_complete_types(int d):R_(d){} + typedef R_ Kernel_base; typedef typename Default::Get::type Derived; #if 0 @@ -73,6 +76,9 @@ template struct Cartesian_com template struct Cartesian_complete_constructors : public R_ { + CGAL_CONSTEXPR Cartesian_complete_constructors(){} + CGAL_CONSTEXPR Cartesian_complete_constructors(int d):R_(d){} + typedef R_ Kernel_base; typedef typename Default::Get::type Derived; template::type> struct Functor : @@ -89,6 +95,9 @@ template struct Cartesian_com template struct Cartesian_complete_predicates : public R_ { + CGAL_CONSTEXPR Cartesian_complete_predicates(){} + CGAL_CONSTEXPR Cartesian_complete_predicates(int d):R_(d){} + // TODO: this doesn't look like the right place for this typedef... typedef CartesianDKernelFunctors::Flat_orientation Flat_orientation; @@ -108,6 +117,9 @@ template struct Cartesian_com template struct Cartesian_complete_computes : public R_ { + CGAL_CONSTEXPR Cartesian_complete_computes(){} + CGAL_CONSTEXPR Cartesian_complete_computes(int d):R_(d){} + typedef R_ Kernel_base; typedef typename Default::Get::type Derived; template::type> struct Functor : diff --git a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_static_filters.h index 36042fd4911..64948d910f1 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_static_filters.h @@ -47,9 +47,16 @@ template struct Orientation_of_points_2 : private Store_k }; } -template struct Cartesian_static_filters : public R_ {}; +template +struct Cartesian_static_filters : public R_ { + CGAL_CONSTEXPR Cartesian_static_filters(){} + CGAL_CONSTEXPR Cartesian_static_filters(int d):R_(d){} +}; -template struct Cartesian_static_filters, R_, Derived_> : public R_ { +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + CGAL_CONSTEXPR Cartesian_static_filters(){} + CGAL_CONSTEXPR Cartesian_static_filters(int d):R_(d){} typedef Cartesian_static_filters, R_, Derived_> Self; typedef typename Default::Get::type Derived; template struct Functor : R_::template Functor {}; diff --git a/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h b/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h index 82706289c37..5e944725fae 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h @@ -9,6 +9,9 @@ namespace CGAL { template struct Kernel_d_interface : public Base_ { + CGAL_CONSTEXPR Kernel_d_interface(){} + CGAL_CONSTEXPR Kernel_d_interface(int d):Base_(d){} + typedef Base_ Base; typedef Kernel_d_interface Kernel; typedef Base_ R_; // for the macros diff --git a/NewKernel_d/test/NewKernel_d/test.cpp b/NewKernel_d/test/NewKernel_d/test.cpp index bd8b08056fb..9b83adac7e4 100644 --- a/NewKernel_d/test/NewKernel_d/test.cpp +++ b/NewKernel_d/test/NewKernel_d/test.cpp @@ -91,11 +91,17 @@ void test2(){ typedef typename K1::In_flat_orientation_d IFO; typedef typename K1::In_flat_side_of_oriented_sphere_d IFSOS; typedef typename K1::Contained_in_affine_hull_d CAH; + typedef typename K1::Compare_lexicographically_d CL; USE_TYPE(V); USE_TYPE(CV); USE_TYPE(FO); - Ker k; + USE_TYPE(CL); + Ker k +#if 0 + (2) +#endif + ; CP cp Kinit(construct_point_d_object); CCI ci Kinit(construct_cartesian_const_iterator_d_object); CC cc Kinit(compute_coordinate_d_object); @@ -148,14 +154,20 @@ void test3(){ typedef typename K1::In_flat_orientation_d IFO; typedef typename K1::In_flat_side_of_oriented_sphere_d IFSOS; typedef typename K1::Contained_in_affine_hull_d CAH; + typedef typename K1::Compare_lexicographically_d CL; USE_TYPE(V); USE_TYPE(CV); USE_TYPE(FO); - Ker k; + Ker k +#if 0 + (3) +#endif + ; CP cp Kinit(construct_point_d_object); CCI ci Kinit(construct_cartesian_const_iterator_d_object); CC cc Kinit(compute_coordinate_d_object); + CL cl Kinit(compare_lexicographically_d_object); PO po Kinit(orientation_d_object); CS cs Kinit(construct_segment_d_object); CSE cse (k); @@ -210,6 +222,8 @@ void test3(){ std::cout << sos(buf+0,buf+5) << '\n'; assert(cah(y+0,y+3,y[3])); assert(!cah(y+0,y+3,buf[0])); + assert(cl(a,a)==CGAL::EQUAL); + assert(cl(a,b)==CGAL::LARGER); } int main(){