diff --git a/NewKernel_d/include/CGAL/Dimension.h b/NewKernel_d/include/CGAL/Dimension.h index 66609cf95c3..06be888abb4 100644 --- a/NewKernel_d/include/CGAL/Dimension.h +++ b/NewKernel_d/include/CGAL/Dimension.h @@ -35,7 +35,7 @@ const int UNKNOWN_DIMENSION=Eigen::Dynamic; const int UNKNOWN_DIMENSION=std::numeric_limits::max(); #endif -bool check_dimension(int d1, int d2){ +inline bool check_dimension(int d1, int d2){ //return (d2==UNKNOWN_DIMENSION)||(d1<=d2); return d1<=d2; } diff --git a/NewKernel_d/include/CGAL/Kernel_d/Kernel_object_converter.h b/NewKernel_d/include/CGAL/Kernel_d/Kernel_object_converter.h index e8b5a1a29bf..3cbb816aac6 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Kernel_object_converter.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Kernel_object_converter.h @@ -1,12 +1,17 @@ #ifndef CGAL_KD_KO_CONVERTER_H #define CGAL_KD_KO_CONVERTER_H +#include #include #include // First_if_different namespace CGAL { template struct KO_converter; //TODO: It would probably be better if this was a Misc Functor in K1. +// This way K1 could chose how it wants to present its points (sparse +// iterator?) and derived classes would inherit it. -template struct KO_converter{ +namespace internal { +template +struct Point_converter_help { typedef typename K1::template Type::type argument_type; typedef typename K2::template Type::type result_type; template @@ -16,6 +21,29 @@ template struct KO_converter{ return cp(conv(i(p,Begin_tag())),conv(i(p,End_tag()))); } }; +#ifdef CGAL_CXX0X +// This doesn't seem so useful, the compiler should be able to handle +// the iterators just as efficiently. +template +struct Point_converter_help,K1,K2> { + typedef typename K1::template Type::type argument_type; + typedef typename K2::template Type::type result_type; + template + result_type help(Indices, K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const { + typename K1::template Functor::type cc(k1); + typename K2::template Functor >::type cp(k2); + return cp(conv(cc(p,I))...); + } + template + result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const { + return help(typename N_increasing_indices::type(),k1,k2,conv,p); + } +}; +#endif +} +template struct KO_converter +: internal::Point_converter_help +{}; template struct KO_converter{ typedef typename K1::template Type::type K1_Vector;