mirror of https://github.com/CGAL/cgal
Converters now simply forward fundamental types, forbid others
This commit is contained in:
parent
5aa34c9106
commit
71cbd212dc
|
|
@ -127,14 +127,20 @@ public:
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
typename K2::FT
|
||||
operator()(const T&,
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
// Disable fundamental types (other than K1::FT) to avoid unexpected results
|
||||
// More details: https://github.com/CGAL/cgal/issues/4982
|
||||
CGAL_static_assertion(!(std::is_fundamental<T>::value));
|
||||
return typename K2::FT();
|
||||
return t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<!std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
CGAL_static_assertion(!(std::is_same<T, T>::value));
|
||||
return t;
|
||||
}
|
||||
|
||||
// drop the boost::detail::variant::void_ generated by the macros
|
||||
|
|
|
|||
|
|
@ -87,14 +87,20 @@ public:
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
typename K2::FT
|
||||
operator()(const T&,
|
||||
typename std::enable_if<std::is_fundamental<T>::value>::type* = nullptr)
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
// Disable fundamental types (other than K1::FT) to avoid unexpected results
|
||||
// More details: https://github.com/CGAL/cgal/issues/4982
|
||||
CGAL_static_assertion(!(std::is_fundamental<T>::value));
|
||||
return typename K2::FT();
|
||||
return t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<!std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
CGAL_static_assertion(!(std::is_same<T, T>::value));
|
||||
return t;
|
||||
}
|
||||
|
||||
typename K2::Point_2
|
||||
|
|
|
|||
|
|
@ -100,14 +100,20 @@ public:
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
typename K2::FT
|
||||
operator()(const T&,
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
// Disable fundamental types (other than K1::FT) to avoid unexpected results
|
||||
// More details: https://github.com/CGAL/cgal/issues/4982
|
||||
CGAL_static_assertion(!(std::is_fundamental<T>::value));
|
||||
return typename K2::FT();
|
||||
return t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
operator()(const T t,
|
||||
typename std::enable_if<!std::is_fundamental<T>::value>::type* = nullptr) const
|
||||
{
|
||||
CGAL_static_assertion(!(std::is_same<T, T>::value));
|
||||
return t;
|
||||
}
|
||||
|
||||
std::vector<Object>
|
||||
|
|
@ -121,11 +127,6 @@ public:
|
|||
return res;
|
||||
}
|
||||
|
||||
int operator()(const int &a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
typename K2::Point_d
|
||||
operator()(const typename K1::Point_d &a) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue