From d8d6935559edb7e0d239d732c96733f0fa69e816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 4 Sep 2020 17:59:48 +0200 Subject: [PATCH] Fix MaxTime conversion when FT is not convertible to K1::FT Although the documentation does say that it is required to be implicitely convertible. In practice, this wasn't checked and failed silently: the FT in the template parameter is not necessarily Input_kernel::FT, but could be e.g. double. Then the call to Cartesian_converter meant that it actually used the overload: bool operator()(bool) { ... } if FT was not convertible to K1::FT (e.g. FT=double and K1=EPECK_w/_SQRT). Thus this returned... 1. This commit changes the requirement to be only constructible rather than convertible, and explicitely creates a K1::FT. --- Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index 52cb9c08407..8594a425e4c 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -55,7 +55,8 @@ create_partial_interior_straight_skeleton_2 ( FT const& aMaxTime Cartesian_converter Converter ; - boost::optional lMaxTime( Converter(aMaxTime) ) ; + KFT kMaxTime = aMaxTime; + boost::optional lMaxTime(kMaxTime) ; SsBuilder ssb( lMaxTime ) ;