diff --git a/Distance_2/test/Distance_2/issue_4189.cpp b/Distance_2/test/Distance_2/issue_4189.cpp new file mode 100644 index 00000000000..03a8c3356c5 --- /dev/null +++ b/Distance_2/test/Distance_2/issue_4189.cpp @@ -0,0 +1,34 @@ +#include + +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian SC; +typedef CGAL::Simple_cartesian EC; + +template +int fct() { + + typedef Kernel::Segment_2 Segment_2; + const Segment_2 segi = { + { -4.0380854964382, -1.9947196614192 }, + { 10.43442091460618, -0.5886833953492263 } }; + const Segment_2 segj = { + { -11.5138934277993, -2.721011070186227 }, + { -8.822747585009402, -2.459560251317805 } }; + + const auto dist = CGAL::squared_distance(segi, segj); + std::cout << "#dist: " << dist << std::endl; + + return 0; +} + +int main() +{ + fct(); + fct(); + fct(); + return 0; +} diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index aaf4b872ce6..5ca5dd5a880 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -4153,7 +4153,7 @@ namespace HomogeneousKernelFunctors { operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { - return Compare_signed_distance_to_line_2::operator()(p, q, r, s) == SMALLER; + return Compare_signed_distance_to_line_2().operator()(p, q, r, s) == SMALLER; } result_type