diff --git a/Kernel_23/include/CGAL/Bbox.h b/Kernel_23/include/CGAL/Bbox.h index fb893cc6e62..ec7b35b4314 100644 --- a/Kernel_23/include/CGAL/Bbox.h +++ b/Kernel_23/include/CGAL/Bbox.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace CGAL { namespace Impl { @@ -122,9 +123,12 @@ protected: } +template +class Bbox; + // A fixed D-dimensional axis aligned box template -class Bbox : public Impl::Bbox, Bbox> +class Bbox> : public Impl::Bbox, Bbox> { enum { D = N }; public: @@ -137,7 +141,7 @@ public: // A dynamic D-dimensional axis aligned box template -class Bbox<0,T> : public Impl::Bbox, Bbox<0,T>> +class Bbox : public Impl::Bbox, Bbox<0,T>> { public: inline int dimension() const { return this->min_values.size(); } diff --git a/Kernel_23/test/Kernel_23/test_bbox.cpp b/Kernel_23/test/Kernel_23/test_bbox.cpp index 05d519ba513..b46deff6f2e 100644 --- a/Kernel_23/test/Kernel_23/test_bbox.cpp +++ b/Kernel_23/test/Kernel_23/test_bbox.cpp @@ -82,7 +82,7 @@ int main() { //Dimension d - typedef CGAL::Bbox<3,double> BBox3; + typedef CGAL::Bbox,double> BBox3; BBox3 bb3(3), bb3a(3,1.0); assert(bb3.dimension() == 3); assert(bb3 != bb3a); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h index 62aabe79401..c2d6b6801ba 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h @@ -1010,15 +1010,16 @@ namespace CartesianDKernelFunctors { template struct ConstructBbox : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(ConstructBbox) typedef R_ R; + typedef typename R::Dimension Dimension; typedef typename Get_type::type RT; typedef typename Get_type::type Point; typedef typename Get_functor >::type CI; - typedef Bbox result_type; + typedef Bbox result_type; typedef Point argument_type; result_type operator()(Point const&a)const{ CI ci(this->kernel()); To_interval f; - return result_type(DIM, make_transforming_iterator(ci(a,Begin_tag()),f), make_transforming_iterator(ci(a,End_tag())), f); + return result_type(a.dimension(), make_transforming_iterator(ci(a,Begin_tag()),f), make_transforming_iterator(ci(a,End_tag())), f); } }; }