Merge pull request #1582 from afabri/Circular_kernel_2-ICL_variant_bug-GF

Circular_kernel_2: Add a dummy field to the variant to work around an ICL bug
This commit is contained in:
Laurent Rineau 2016-10-20 09:47:35 +02:00
commit 08126075a7
4 changed files with 72 additions and 16 deletions

View File

@ -38,13 +38,23 @@ struct CK2_Intersection_traits
{};
// Intersection_traits for the circular kernel
// The additional CGAL_ADDITIONAL_VARIANT_FOR_ICL ( = int) in the variant
// has the only purpose to work around a bug of the Intel compiler,
// which without it produces the error
// /usr/include/boost/type_traits/has_nothrow_copy.hpp(36): internal error: bad pointer
// template struct has_nothrow_copy_constructor : public integral_constant{};
// See also https://github.com/CGAL/cgal/issues/1581
template<typename CK>
struct CK2_Intersection_traits<CK, typename CK::Circle_2, typename CK::Circle_2>
{
typedef typename
boost::variant< typename CK::Circle_2,
typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -54,7 +64,9 @@ struct CK2_Intersection_traits<CK, typename CK::Circular_arc_2, typename CK::Cir
typedef typename
boost::variant< typename CK::Circular_arc_2,
typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -64,7 +76,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_arc_2, typename CK::Line_ar
typedef typename
boost::variant< typename CK::Line_arc_2,
typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -73,7 +87,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_arc_2, typename CK::Circle_
{
typedef typename
boost::variant< typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -87,7 +103,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_arc_2, typename CK::Circula
{
typedef typename
boost::variant< typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -102,7 +120,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_arc_2, typename CK::Line_2>
typedef typename
boost::variant< typename CK::Line_arc_2,
typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -116,7 +136,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_2, typename CK::Circular_ar
{
typedef typename
boost::variant< typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};
@ -144,7 +166,9 @@ struct CK2_Intersection_traits<CK, typename CK::Line_2, typename CK::Circle_2>
{
typedef typename
boost::variant< typename std::pair< typename CK::Circular_arc_point_2,
unsigned int > >
unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
>
type;
};

View File

@ -508,6 +508,13 @@ namespace CircularFunctors {
bool operator()(const std::pair<typename CK::Circular_arc_point_2, unsigned>& pair) const {
return has_on<CK>(*l,pair.first,true);
}
#ifdef CGAL_ADDITIONAL_VARIANT_FOR_ICL
bool operator()(const int) const
{
return true;
}
#endif
};
template< class CK, class OutputIterator>

View File

@ -35,11 +35,21 @@ template <typename SK, typename T1, typename T2, typename T3=void*>
struct SK3_Intersection_traits
{};
// Intersection_traits for the circular kernel
// The additional CGAL_ADDITIONAL_VARIANT_FOR_ICL ( = int) in the variant
// has the only purpose to work around a bug of the Intel compiler,
// which without it produces the error
// /usr/include/boost/type_traits/has_nothrow_copy.hpp(36): internal error: bad pointer
// template struct has_nothrow_copy_constructor : public integral_constant{};
// See also https://github.com/CGAL/cgal/issues/1581
template <typename SK>
struct SK3_Intersection_traits<SK, typename SK::Sphere_3, typename SK::Line_3>
{
typedef boost::variant<
std::pair< typename SK::Circular_arc_point_3, unsigned int >
std::pair< typename SK::Circular_arc_point_3, unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -52,19 +62,22 @@ struct SK3_Intersection_traits<SK, typename SK::Circle_3, typename SK::Plane_3>
{
typedef boost::variant<
std::pair< typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Circle_3
typename SK::Circle_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type; };
template <typename SK>
struct SK3_Intersection_traits<SK, typename SK::Plane_3, typename SK::Circle_3>
: SK3_Intersection_traits<SK, typename SK::Circle_3, typename SK::Plane_3> {};
template <typename SK>
struct SK3_Intersection_traits<SK, typename SK::Circle_3, typename SK::Sphere_3>
{
typedef boost::variant<
std::pair< typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Circle_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -77,7 +90,8 @@ struct SK3_Intersection_traits<SK, typename SK::Circle_3, typename SK::Circle_3>
{
typedef boost::variant<
std::pair <typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Circle_3
typename SK::Circle_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -85,7 +99,8 @@ template <typename SK>
struct SK3_Intersection_traits<SK, typename SK::Circle_3, typename SK::Line_3>
{
typedef boost::variant<
std::pair <typename SK::Circular_arc_point_3, unsigned int >
std::pair <typename SK::Circular_arc_point_3, unsigned int >
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -99,7 +114,8 @@ struct SK3_Intersection_traits<SK, typename SK::Circular_arc_3, typename SK::Cir
typedef boost::variant<
typename SK::Circle_3,
std::pair <typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Circular_arc_3
typename SK::Circular_arc_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -108,7 +124,8 @@ struct SK3_Intersection_traits<SK, typename SK::Circular_arc_3, typename SK::Pla
{
typedef boost::variant<
std::pair <typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Circular_arc_3
typename SK::Circular_arc_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -121,7 +138,8 @@ struct SK3_Intersection_traits<SK, typename SK::Line_arc_3, typename SK::Line_ar
{
typedef boost::variant<
std::pair <typename SK::Circular_arc_point_3, unsigned int >,
typename SK::Line_arc_3
typename SK::Line_arc_3
CGAL_ADDITIONAL_VARIANT_FOR_ICL
> type;
};
@ -133,7 +151,8 @@ struct SK3_intersect_ternary
typename SK::Circle_3,
typename SK::Plane_3,
typename SK::Sphere_3,
std::pair< typename SK::Circular_arc_point_3, unsigned >
std::pair< typename SK::Circular_arc_point_3, unsigned >,
int
> type;
};

View File

@ -584,4 +584,10 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t
# define CGAL_NO_ASSERTIONS_BOOL true
#endif
#if defined( __INTEL_COMPILER)
#define CGAL_ADDITIONAL_VARIANT_FOR_ICL ,int
#else
#define CGAL_ADDITIONAL_VARIANT_FOR_ICL
#endif
#endif // CGAL_CONFIG_H