From 10eb694d380fffce2914c511c5f99893dc3d0256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 13 Oct 2022 23:11:05 +0200 Subject: [PATCH] Replace if constexpr with C++14 compatible code --- .../include/CGAL/Filtered_predicate.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate.h b/Filtered_kernel/include/CGAL/Filtered_predicate.h index 90e9a554f75..8cbcaa2835a 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate.h @@ -122,6 +122,7 @@ class Filtered_predicate_RT_FT public: using result_type = typename Remove_needs_FT::Type; +private: template struct Call_operator_needs_FT { @@ -130,6 +131,15 @@ public: enum { value = std::is_same >::value }; }; + template ::value>* = nullptr> + result_type call(const Args&... args) const { return ep_ft(c2e_ft(args)...); } + + template ::value>* = nullptr> + result_type call(const Args&... args) const { return ep_rt(c2e_rt(args)...); } + +public: // ## Important note // // If you want to remove of rename that member function template `needs_FT`, @@ -159,14 +169,11 @@ public: CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding p(CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); - if constexpr (Call_operator_needs_FT::value) - return ep_ft(c2e_ft(args)...); - else - return ep_rt(c2e_rt(args)...); + + return call(args...); } }; - -} //namespace CGAL +} // namespace CGAL #endif // CGAL_FILTERED_PREDICATE_H