diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index 89595b5ef34..576c6e78599 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -127,14 +127,20 @@ public: } template - typename K2::FT - operator()(const T&, + T + operator()(const T t, typename std::enable_if::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::value)); - return typename K2::FT(); + return t; + } + + template + T + operator()(const T t, + typename std::enable_if::value>::type* = nullptr) const + { + CGAL_static_assertion(!(std::is_same::value)); + return t; } // drop the boost::detail::variant::void_ generated by the macros diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous_converter.h b/Homogeneous_kernel/include/CGAL/Homogeneous_converter.h index b8cc0939f1b..cb22a9548b9 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous_converter.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous_converter.h @@ -87,14 +87,20 @@ public: } template - typename K2::FT - operator()(const T&, - typename std::enable_if::value>::type* = nullptr) + T + operator()(const T t, + typename std::enable_if::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::value)); - return typename K2::FT(); + return t; + } + + template + T + operator()(const T t, + typename std::enable_if::value>::type* = nullptr) const + { + CGAL_static_assertion(!(std::is_same::value)); + return t; } typename K2::Point_2 diff --git a/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h b/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h index cb801622c9f..c207c83dee7 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h @@ -100,14 +100,20 @@ public: } template - typename K2::FT - operator()(const T&, + T + operator()(const T t, typename std::enable_if::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::value)); - return typename K2::FT(); + return t; + } + + template + T + operator()(const T t, + typename std::enable_if::value>::type* = nullptr) const + { + CGAL_static_assertion(!(std::is_same::value)); + return t; } std::vector @@ -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 {