diff --git a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_LA_base.h b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_LA_base.h index 192a3024b5b..482a8912b07 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_LA_base.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_LA_base.h @@ -64,6 +64,8 @@ struct Cartesian_LA_base_d : public Dimension_base template struct Type {}; template struct Type< Point_tag, D> { typedef Vector_ type; }; template struct Type { typedef Vector_ type; }; + template struct Type< RT_tag, D> { typedef RT type; }; + template struct Type< FT_tag, D> { typedef FT type; }; typedef typeset ::add::type diff --git a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_change_FT.h b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_change_FT.h index f906581e2eb..d9a05bb0dad 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Cartesian_change_FT.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Cartesian_change_FT.h @@ -48,9 +48,9 @@ struct Cartesian_change_FT_base : public }; */ - template + template struct Construct_cartesian_const_iterator_ { - typedef typename Get_functor::type Functor_base; + typedef typename Get_functor::type Functor_base; Construct_cartesian_const_iterator_(){} Construct_cartesian_const_iterator_(Self const&r):f(r){} Functor_base f; @@ -67,9 +67,9 @@ struct Cartesian_change_FT_base : public typedef Construct_cartesian_const_iterator_,Point_cartesian_const_iterator> Construct_point_cartesian_const_iterator; typedef Construct_cartesian_const_iterator_,Vector_cartesian_const_iterator> Construct_vector_cartesian_const_iterator; - template + template struct Compute_cartesian_coordinate { - typedef typename Get_functor::type Functor_base; + typedef typename Get_functor::type Functor_base; Compute_cartesian_coordinate(){} Compute_cartesian_coordinate(Self const&r):f(r){} Functor_base f; diff --git a/NewKernel_d/include/CGAL/Kernel_d/Define_kernel_types.h b/NewKernel_d/include/CGAL/Kernel_d/Define_kernel_types.h index 42e9e84b1c4..bbf981b8848 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Define_kernel_types.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Define_kernel_types.h @@ -10,10 +10,10 @@ namespace CGAL { namespace internal { - template::is_iterator> - struct Type_or_iter : K::template Type {}; - template - struct Type_or_iter : K::template Iterator {}; + template::is_iterator> + struct Type_or_iter : K::template Type {}; + template + struct Type_or_iter : K::template Iterator {}; } template::type> struct Define_kernel_types; template diff --git a/NewKernel_d/include/CGAL/Kernel_d/KernelD_converter.h b/NewKernel_d/include/CGAL/Kernel_d/KernelD_converter.h index f53eaed3998..5a4b45bbf4c 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/KernelD_converter.h +++ b/NewKernel_d/include/CGAL/Kernel_d/KernelD_converter.h @@ -52,13 +52,13 @@ template class KernelD_converter_ : public KernelD_converter_ { - typedef typename List::head Tag; + typedef typename List::head Tag_; typedef typename List::tail Rest; typedef KernelD_converter_ Base; - typedef typename Get_type::type K1_Obj; - typedef typename Get_type::type K2_Obj; - typedef typename Get_functor >::type K1_Conv; - typedef KO_converter KOC; + typedef typename Get_type::type K1_Obj; + typedef typename Get_type::type K2_Obj; + typedef typename Get_functor >::type K1_Conv; + typedef KO_converter KOC; typedef BOOSTD is_same no_converter; typedef typename internal::Map_taglist_to_typelist::type::template contains duplicate; @@ -68,7 +68,7 @@ class KernelD_converter_ // If Point==Vector, keep only one conversion duplicate::value || // For iterator objects, the default is make_transforming_iterator - (iterator_tag_traits::is_iterator && no_converter::value), + (iterator_tag_traits::is_iterator && no_converter::value), Do_not_use,K1_Obj>::type argument_type; //typedef typename KOC::argument_type K1_Obj; //typedef typename KOC::result_type K2_Obj; 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 ddad6f1cfe1..799708205b6 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Kernel_d_interface.h @@ -79,12 +79,12 @@ template struct Kernel_d_interface : public Base_ { // Kernel_d requires a common iterator type for points and vectors // TODO: provide this mixed functor in preKernel? CGAL_static_assertion((boost::is_same::type>::type, result_type>::value)); - template - result_type operator()(Point_d const&p, Tag t)const{ + template + result_type operator()(Point_d const&p, Tag_ t)const{ return CPI(this->kernel())(p,t); } - template - result_type operator()(Vector_d const&v, Tag t)const{ + template + result_type operator()(Vector_d const&v, Tag_ t)const{ return CVI(this->kernel())(v,t); } diff --git a/NewKernel_d/include/CGAL/functor_tags.h b/NewKernel_d/include/CGAL/functor_tags.h index 94e99dda802..5c7370ee97e 100644 --- a/NewKernel_d/include/CGAL/functor_tags.h +++ b/NewKernel_d/include/CGAL/functor_tags.h @@ -41,16 +41,16 @@ namespace CGAL { templatestruct Convert_ttag {}; template struct map_functor_type { typedef Misc_tag type; }; - template struct Typedef_tag_type; - //template struct Read_tag_type {}; + template struct Typedef_tag_type; + //template struct Read_tag_type {}; - template + template struct Provides_type - : Has_type_different_from, Null_type> {}; + : Has_type_different_from, Null_type> {}; - template + template struct Provides_functor - : Has_type_different_from, Null_functor> {}; + : Has_type_different_from, Null_functor> {}; template::type::value> struct Provides_functors : boost::mpl::and_ < @@ -67,25 +67,27 @@ namespace CGAL { struct Provides_types : boost::true_type {}; namespace internal { BOOST_MPL_HAS_XXX_TEMPLATE_DEF(Type) } - template::value /* false */> struct Provides_type_i : boost::false_type {}; - template - struct Provides_type_i - : Has_type_different_from, Null_type> {}; + template + struct Provides_type_i + : Has_type_different_from, Null_type> {}; namespace internal { BOOST_MPL_HAS_XXX_TEMPLATE_DEF(Functor) } - template::value /* false */> struct Provides_functor_i : boost::false_type {}; - template - struct Provides_functor_i - : Has_type_different_from, Null_type> {}; + template + struct Provides_functor_i + : Has_type_different_from, Null_type> {}; -#define DECL_OBJ(X) struct X##_tag {}; \ +#define DECL_OBJ_(X) \ template \ - struct Typedef_tag_type : Base { typedef Obj X; }; + struct Typedef_tag_type : Base { typedef Obj X; } +#define DECL_OBJ(X) struct X##_tag {}; \ + DECL_OBJ_(X) //namespace has_object { BOOST_MPL_HAS_XXX_TRAIT_DEF(X) } //template @@ -97,6 +99,14 @@ namespace CGAL { DECL_OBJ(FT); DECL_OBJ(RT); + //DECL_OBJ(Boolean); // FIXME: Boolean_tag is already taken, and is a template :-( + DECL_OBJ(Comparison_result); + DECL_OBJ(Sign); + DECL_OBJ(Orientation); // Note: duplicate with the functor tag! + DECL_OBJ(Oriented_side); + DECL_OBJ(Bounded_side); + DECL_OBJ(Angle); + DECL_OBJ(Vector); DECL_OBJ(Point); DECL_OBJ(Segment); @@ -108,6 +118,7 @@ namespace CGAL { DECL_OBJ(Iso_box); DECL_OBJ(Bbox); DECL_OBJ(Aff_transformation); +#undef DECL_OBJ_ #undef DECL_OBJ template struct is_NT_tag { enum { value = false }; }; @@ -140,7 +151,7 @@ namespace CGAL { typedef C##_tag container; \ }; \ template \ - struct Typedef_tag_type : Base { typedef Obj X; }; + struct Typedef_tag_type : Base { typedef Obj X; } //namespace has_object { BOOST_MPL_HAS_XXX_TRAIT_DEF(X) } //template @@ -187,8 +198,10 @@ namespace CGAL { #endif //FIXME: choose a convention: prefix with Predicate_ ? -#define DECL_PREDICATE(X) struct X##_tag {}; \ +#define DECL_PREDICATE_(X) \ template<>struct map_functor_type{typedef Predicate_tag type;} +#define DECL_PREDICATE(X) struct X##_tag {}; \ + DECL_PREDICATE_(X) DECL_PREDICATE(Less_point_cartesian_coordinate); DECL_PREDICATE(Compare_point_cartesian_coordinate); DECL_PREDICATE(Compare_distance); @@ -196,7 +209,7 @@ namespace CGAL { DECL_PREDICATE(Less_lexicographically); DECL_PREDICATE(Less_or_equal_lexicographically); DECL_PREDICATE(Equal_points); - DECL_PREDICATE(Orientation); + DECL_PREDICATE_(Orientation); // duplicate with the type DECL_PREDICATE(Orientation_of_points); DECL_PREDICATE(Orientation_of_vectors); DECL_PREDICATE(Side_of_oriented_sphere); diff --git a/NewKernel_d/include/CGAL/is_iterator.h b/NewKernel_d/include/CGAL/is_iterator.h index 02cf09b0d14..591a26d86d6 100644 --- a/NewKernel_d/include/CGAL/is_iterator.h +++ b/NewKernel_d/include/CGAL/is_iterator.h @@ -48,8 +48,8 @@ template struct is_iterator_type_ : template struct is_iterator : internal::is_iterator_::type>::type> {}; -template struct is_iterator_type : - internal::is_iterator_type_::type>::type,Tag> {}; +template struct is_iterator_type : + internal::is_iterator_type_::type>::type,Tg> {}; template ::value> struct is_iterator_to { enum { value=false }; diff --git a/NewKernel_d/include/CGAL/marcutils.h b/NewKernel_d/include/CGAL/marcutils.h index 38256545e8e..c825634d97a 100644 --- a/NewKernel_d/include/CGAL/marcutils.h +++ b/NewKernel_d/include/CGAL/marcutils.h @@ -231,14 +231,15 @@ BOOST_PP_REPEAT_FROM_TO(1, 8, CODE, _ ) }; } +// TODO: make a Cartesian-only variant #define CGAL_STRIP_PAREN_(...) __VA_ARGS__ #define CGAL_STRIP_PAREN(...) CGAL_STRIP_PAREN_ __VA_ARGS__ // What to do with O? pass it down to other functors or drop it? -#define CGAL_KD_DEFAULT_FUNCTOR(Tag,Name,ReqTyp,ReqFun) \ +#define CGAL_KD_DEFAULT_FUNCTOR(Tg,Name,ReqTyp,ReqFun) \ template \ - struct Get_functor::value \ + Provides_functor_i::value \ || !Provides_types >::value \ || !Provides_functors >::value \ , int, void>::type> \ @@ -247,11 +248,11 @@ BOOST_PP_REPEAT_FROM_TO(1, 8, CODE, _ ) } // Not used yet, may need some changes. -#define CGAL_KD_DEFAULT_TYPE(Tag,Name,ReqTyp,ReqFun) \ +#define CGAL_KD_DEFAULT_TYPE(Tg,Name,ReqTyp,ReqFun) \ template \ - struct Get_type::value \ + Provides_type_i::value \ || !Provides_types >::value \ || !Provides_functors >::value \ , int, void>::type> \