mirror of https://github.com/CGAL/cgal
correctly forward result_type in Circular_kernel_2
Conflicts: Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h
This commit is contained in:
parent
d84d793ead
commit
debf525a02
|
|
@ -41,6 +41,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <CGAL/Circular_kernel_2/Intersection_traits.h>
|
#include <CGAL/Circular_kernel_2/Intersection_traits.h>
|
||||||
|
#include <CGAL/result_of.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
@ -631,12 +632,14 @@ public:
|
||||||
return _support;
|
return _support;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Point_2 & center() const
|
typename cpp11::result_of<typename CK::Construct_center_2(Circle_2)>::type
|
||||||
|
center() const
|
||||||
{
|
{
|
||||||
return supporting_circle().center();
|
return supporting_circle().center();
|
||||||
}
|
}
|
||||||
|
|
||||||
const FT & squared_radius() const
|
typename cpp11::result_of<typename CK::Compute_squared_radius_2(Circle_2)>::type
|
||||||
|
squared_radius() const
|
||||||
{
|
{
|
||||||
return supporting_circle().squared_radius();
|
return supporting_circle().squared_radius();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -630,7 +630,20 @@ namespace CircularFunctors {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef void result_type;
|
template<typename>
|
||||||
|
struct result;
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result<F(typename CK::Line_2)>
|
||||||
|
{
|
||||||
|
typedef typename CK::Polynomial_1_2 type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result<F(typename CK::Circle_2)>
|
||||||
|
{
|
||||||
|
typedef typename CK::Polynomial_for_circles_2_2 type;
|
||||||
|
};
|
||||||
|
|
||||||
typename CK::Polynomial_1_2
|
typename CK::Polynomial_1_2
|
||||||
operator() ( const typename CK::Line_2 & l )
|
operator() ( const typename CK::Line_2 & l )
|
||||||
|
|
@ -1265,40 +1278,36 @@ namespace CircularFunctors {
|
||||||
typedef typename CK::FT FT;
|
typedef typename CK::FT FT;
|
||||||
typedef typename CK::Point_2 Point_2;
|
typedef typename CK::Point_2 Point_2;
|
||||||
typedef typename CK::Circle_2 Circle_2;
|
typedef typename CK::Circle_2 Circle_2;
|
||||||
typedef FT forwarded_result_type;
|
|
||||||
public:
|
public:
|
||||||
template<typename>
|
template<typename>
|
||||||
struct result{
|
struct result{
|
||||||
typedef forwarded_result_type type;
|
typedef FT type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
struct result<F(Circular_arc_2)> {
|
struct result<F(Circular_arc_2)> {
|
||||||
typedef const forwarded_result_type& type;
|
typedef typename cpp11::result_of<LK_Compute_squared_radius_2(Circle_2)>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
struct result<F(Circle_2)> {
|
struct result<F(Circle_2)> {
|
||||||
typedef const forwarded_result_type& type;
|
typedef typename cpp11::result_of<LK_Compute_squared_radius_2(Circle_2)>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const forwarded_result_type&
|
typename cpp11::result_of<LK_Compute_squared_radius_2(Circle_2)>::type
|
||||||
operator()( const Circle_2& c) const
|
operator()( const Circle_2& c) const
|
||||||
{ return LK_Compute_squared_radius_2()(c); }
|
{ return LK_Compute_squared_radius_2()(c); }
|
||||||
|
|
||||||
forwarded_result_type
|
FT operator()( const Point_2& p) const
|
||||||
operator()( const Point_2& p) const
|
|
||||||
{ return LK_Compute_squared_radius_2()(p); }
|
{ return LK_Compute_squared_radius_2()(p); }
|
||||||
|
|
||||||
forwarded_result_type
|
FT operator()( const Point_2& p, const Point_2& q) const
|
||||||
operator()( const Point_2& p, const Point_2& q) const
|
|
||||||
{ return LK_Compute_squared_radius_2()(p, q); }
|
{ return LK_Compute_squared_radius_2()(p, q); }
|
||||||
|
|
||||||
forwarded_result_type
|
FT operator()( const Point_2& p, const Point_2& q, const Point_2& r) const
|
||||||
operator()( const Point_2& p, const Point_2& q, const Point_2& r) const
|
|
||||||
{ return LK_Compute_squared_radius_2()(p, q, r); }
|
{ return LK_Compute_squared_radius_2()(p, q, r); }
|
||||||
|
|
||||||
const forwarded_result_type&
|
typename cpp11::result_of<LK_Compute_squared_radius_2(Circle_2)>::type
|
||||||
operator()(const Circular_arc_2& c) const
|
operator()(const Circular_arc_2& c) const
|
||||||
{ return c.rep().squared_radius(); }
|
{ return c.rep().squared_radius(); }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue