diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 2f1201ee239..34efbf7ab37 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -97,6 +98,10 @@ CGAL_LAZY_FORWARD(Bbox_2) CGAL_LAZY_FORWARD(Bbox_3) #undef CGAL_LAZY_FORWARD +template Bbox const& approx(Bbox const& d) { return d; } +template Bbox const& exact (Bbox const& d) { return d; } +template int depth (Bbox const& ) { return 0; } + templateinline std::enable_if_t::value||std::is_enum::value, T> approx(T d){return d;} templateinline std::enable_if_t::value||std::is_enum::value, T> exact (T d){return d;} templateinline std::enable_if_t::value||std::is_enum::value, int> depth(T){return -1;} diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_base.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_base.h index d8df41f68b4..9aecb942bb1 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_base.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_LA_base.h @@ -74,7 +74,6 @@ struct Cartesian_LA_base_d : public Dimension_base template struct Type { typedef Vector_ type; }; template struct Type< FT_tag, D> { typedef FT_ type; }; template struct Type< RT_tag, D> { typedef FT_ type; }; - template struct Type< Bbox_tag, D> { typedef Bbox type; }; typedef typeset ::add::type diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h index db43fd7fde4..84e5bd06ea1 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Lazy_cartesian.h @@ -221,9 +221,6 @@ struct Lazy_cartesian_types template struct Type { typedef CGAL::Lazy_exact_nt::type> type; }; - template struct Type { - typedef typename Get_type::type type; - }; template struct Iterator { typedef typename iterator_tag_traits::value_tag Vt; @@ -281,13 +278,11 @@ struct Lazy_cartesian : C2A(){} C2A(Kernel const&, Approximate_kernel const&){} templatedecltype(auto)operator()(T const&t)const{return CGAL::approx(t);} - template Bbox operator()(const Bbox& b) const{ return b; } }; struct C2E { C2E(){} C2E(Kernel const&, Exact_kernel const&){} templatedecltype(auto)operator()(T const&t)const{return CGAL::exact(t);} - template Bbox operator()(const Bbox& b) const{ return b; } }; typedef typename Exact_kernel::Rep_tag Rep_tag; @@ -314,42 +309,15 @@ struct Lazy_cartesian : template struct Functor { typedef Lazy_construction2 type; }; - //specialize for Bbox - template struct Functor - { - struct type - { - template - type(TT){} - template - auto operator()(const TT& t) const - { - return CartesianDKernelFunctors::Construct_bbox()(approx(t)); - } - }; - }; - - - - template struct Functor { - typedef typename Get_functor::type FA; + template struct Functor { + typedef typename Get_functor::type FA; struct type { FA fa; type(){} type(Kernel const&k):fa(k.approximate_kernel()){} - template - int operator()(P const&p)const{return fa(CGAL::approx(p));} - }; - }; - template struct Functor { - typedef typename Get_functor::type FA; - struct type { - FA fa; - type(){} - type(Kernel const&k):fa(k.approximate_kernel()){} - template - int operator()(V const&v)const{return fa(CGAL::approx(v));} + template + decltype(auto) operator()(P&&...p)const{return fa(CGAL::approx(std::forward

(p))...);} }; }; template struct Functor { diff --git a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h index fbac8ed3d89..210be275766 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h @@ -157,7 +157,6 @@ namespace CGAL { CGAL_DECL_OBJ(Hyperplane, Object); CGAL_DECL_OBJ(Ray, Object); CGAL_DECL_OBJ(Iso_box, Object); - CGAL_DECL_OBJ(Bbox, Bbox); CGAL_DECL_OBJ(Aff_transformation, Object); CGAL_DECL_OBJ(Weighted_point, Object); #undef CGAL_DECL_OBJ_ @@ -260,7 +259,6 @@ namespace CGAL { CGAL_DECL_CONSTRUCT(Construct_circumcenter,Point); CGAL_DECL_CONSTRUCT(Point_drop_weight,Point); CGAL_DECL_CONSTRUCT(Power_center,Weighted_point); - CGAL_DECL_CONSTRUCT(Construct_bbox,Bbox); #undef CGAL_DECL_CONSTRUCT #if 0 #define CGAL_DECL_ITER_CONSTRUCT(X,Y) struct X##_tag {}; \ @@ -315,6 +313,7 @@ namespace CGAL { //CGAL_DECL_MISC(Construct_vector_cartesian_const_iterator); CGAL_DECL_MISC(Point_dimension); CGAL_DECL_MISC(Vector_dimension); + CGAL_DECL_MISC(Construct_bbox); CGAL_DECL_MISC(Linear_base); // Find a more appropriate category? #undef CGAL_DECL_MISC