From 8c95fcca9cb0229a3fccd833f1001049ff9200c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 8 Jan 2025 17:20:44 +0100 Subject: [PATCH] Update Filtered_predicate_with_state not to rely on a 'result_type' typedef --- .../CGAL/Filtered_predicate_with_state.h | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h b/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h index c0b2e2179ca..d29cd3b9b9d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate_with_state.h @@ -33,33 +33,27 @@ class Filtered_predicate_with_state O1 o1; mutable boost::optional oep; AP ap; - typedef typename AP::result_type Ares; public: - + // AP::result_type must be convertible to EP::result_type. typedef AP Approximate_predicate; typedef EP Exact_predicate; typedef C2E To_exact_converter; typedef C2A To_approximate_converter; - typedef typename EP::result_type result_type; - // AP::result_type must be convertible to EP::result_type. - Filtered_predicate_with_state(const O1 &o1) : c2e(), c2a(), o1(o1), oep(), ap(c2a(o1)) {} template - result_type - operator()(const Args&... args) const; -}; - -template - template -typename Filtered_predicate_with_state::result_type -Filtered_predicate_with_state:: + auto operator()(const Args&... args) const -{ + { + typedef typename Remove_needs_FT >::Type result_type; + +#ifndef CGAL_EPICK_NO_INTERVALS + typedef typename Remove_needs_FT >::Type Ares; + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG { @@ -68,18 +62,22 @@ Filtered_predicate_with_state:: { Ares res = ap(c2a(args)...); if (is_certain(res)) - return get_certain(res); + return result_type(get_certain(res)); } catch (Uncertain_conversion_exception&) {} } CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding p(CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); +#endif if(! oep){ oep.emplace(c2e(o1)); } - return (*oep)(c2e(args)...); -} + return result_type((*oep)(c2e(args)...)); + } +}; + + } //namespace CGAL