Make all conversions between Point and Weighted_point explicit

Also doc changes
This commit is contained in:
Mael Rouxel-Labbé 2017-04-11 17:03:08 +02:00
parent e63de324ec
commit e95d3d3f2b
9 changed files with 21 additions and 8 deletions

View File

@ -53,6 +53,7 @@ public:
Weighted_pointC2(const Origin &o)
: base(o, 0) {}
explicit
Weighted_pointC2 (const Point_2 &p)
: base(p,0)
{}

View File

@ -53,6 +53,7 @@ public:
Weighted_pointH2(const Origin &o)
: base(o, 0) {}
explicit
Weighted_pointH2 (const Point_2 &p)
: base(p,0)
{}

View File

@ -85,8 +85,11 @@ Point_2(const Kernel::FT &x, const Kernel::FT &y);
/*!
introduces a point from a weighted point.
\warning The `explicit` keyword is used to not have accidental implicit conversions
between Point_2 and Weighted_point_2.
*/
Point_2(const Kernel::Weighted_point_2 &wp);
explicit Point_2(const Kernel::Weighted_point_2 &wp);
/// @}

View File

@ -66,8 +66,11 @@ Point_3(const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z);
/*!
introduces a point from a weighted point.
\warning The `explicit` keyword is used to not have accidental implicit conversions
between Point_3 and Weighted_point_3.
*/
Point_3(const Kernel::Weighted_point_3 &wp);
explicit Point_3(const Kernel::Weighted_point_3 &wp);
/// @}

View File

@ -47,6 +47,9 @@ public:
/*!
introduces a weighted point from point `p` and weight `0`.
\warning The `explicit` keyword is used to not have accidental implicit conversions
between Point_2 and Weighted_point_2.
*/
Weighted_point_2(const Point_2<Kernel>& p);

View File

@ -78,11 +78,10 @@ public:
: RPoint_2(p)
{}
#if 0
explicit
Point_2(const Weighted_point_2& wp)
: Rep(wp.point())
{}
#endif
template < typename T1, typename T2 >
Point_2(const T1 &x, const T2 &y)

View File

@ -74,11 +74,12 @@ public:
Point_3(const Rep& p)
: Rep(p) {}
#if 0
explicit
Point_3(const Weighted_point_3& wp)
: Rep(wp.point())
{}
#endif
template < typename T1, typename T2, typename T3 >
Point_3(const T1& x, const T2& y, const T3& z)
: Rep(typename R::Construct_point_3()(Return_base_tag(), x, y, z))

View File

@ -76,7 +76,8 @@ public:
Weighted_point_2(const Rep& p)
: Rep(p) {}
explicit Weighted_point_2(const Point_2& p)
explicit
Weighted_point_2(const Point_2& p)
: Rep(typename R::Construct_weighted_point_2()(Return_base_tag(), p, 0))
{}

View File

@ -78,7 +78,8 @@ public:
Weighted_point_3(const Rep& p)
: Rep(p) {}
explicit Weighted_point_3(const Point_3& p)
explicit
Weighted_point_3(const Point_3& p)
: Rep(typename R::Construct_weighted_point_3()(Return_base_tag(), p, 0))
{}