diff --git a/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h b/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h index 40fa50e6623..dd3ef79f343 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h @@ -28,6 +28,43 @@ CGAL_BEGIN_NAMESPACE /////////// COERCION_TRAITS BEGIN +// and vice versa +template +struct Coercion_traits_for_level,int,CTL_SQRT_EXT>{ +public: + typedef Sqrt_extension Type; + typedef CGAL::Tag_true Are_explicit_interoperable; + typedef CGAL::Tag_true Are_implicit_interoperable; + struct Cast{ + Type operator()(const Type& x) const { return x;} + Type operator()(int x) const { return Type(x);} + }; +}; + +template +struct Coercion_traits_for_level,CTL_SQRT_EXT> + : public Coercion_traits_for_level,int,CTL_SQRT_EXT>{}; + + + + +template +struct Coercion_traits_for_level,Coeff,CTL_SQRT_EXT>{ +public: + typedef Sqrt_extension Type; + typedef CGAL::Tag_true Are_explicit_interoperable; + typedef CGAL::Tag_true Are_implicit_interoperable; + struct Cast{ + Type operator()(const Type& x) const { return x;} + Type operator()(Coeff x) const { return Type(x);} + }; +}; + +template +struct Coercion_traits_for_level,CTL_SQRT_EXT> + : public Coercion_traits_for_level,Coeff,CTL_SQRT_EXT>{}; + + // template struct Coercion_traits_for_level, @@ -64,17 +101,17 @@ public: }; }; + template -struct Coercion_traits_for_level, -Root_2>, +struct Coercion_traits_for_level,Root_2>, Sqrt_extension, CTL_SQRT_EXT>{ private: typedef Sqrt_extension, Root_2> A; typedef Sqrt_extension B; public: - typedef CGAL::Tag_true Are_explicit_interoperable; - typedef CGAL::Tag_false Are_implicit_interoperable; + typedef CGAL::Tag_true Are_explicit_interoperable; + typedef CGAL::Tag_true Are_implicit_interoperable; // Type = A typedef Sqrt_extension, Root_2> Type; @@ -98,6 +135,7 @@ struct Coercion_traits_for_level ,CTL_SQRT_EXT> {}; + template struct Coercion_traits_for_level < @@ -108,8 +146,8 @@ private: typedef Sqrt_extension, Root_1> A; typedef Sqrt_extension B; public: - typedef CGAL::Tag_true Are_explicit_interoperable; - typedef CGAL::Tag_false Are_implicit_interoperable; + typedef CGAL::Tag_true Are_explicit_interoperable; + typedef CGAL::Tag_true Are_implicit_interoperable; typedef Sqrt_extension, Root_1> Type; struct Cast{