From f8323e7df8e4d646b9f8e2cbb757f27e78a2ca60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jun 2023 10:52:25 +0200 Subject: [PATCH] use std API --- .../Algebraic_curve_kernel_2.h | 2 +- ...gebraic_real_quadratic_refinement_rep_bfi.h | 18 +++++++++--------- .../Arr_trapezoid_ric_pl_impl.h | 4 ++-- .../CGAL/Arrangement_2/Arr_traits_adaptor_2.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index b249fbf4629..01798000c55 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -368,7 +368,7 @@ public: result_type operator() (const argument_type& arg) const { CGAL_assertion(bool(_inner)); CGAL_assertion(bool(_outer)); - return _outer.get()(_inner.get()(arg)); + return _outer.value()(_inner.value()(arg)); } private: ::std::optional _inner; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h index 9e1cff2083b..06effd6b5dd 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h @@ -113,8 +113,8 @@ private: low_bfi_ = CGAL::convert_to_bfi(this->low()); high_bfi_ = CGAL::convert_to_bfi(this->high()); - f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); - f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); + f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value()); + f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value()); } @@ -125,7 +125,7 @@ private: } m_bfi = CGAL::convert_to_bfi(m); - f_m_bfi = f_bfi_.get().evaluate(m_bfi); + f_m_bfi = f_bfi_.value().evaluate(m_bfi); if(CGAL::zero_in(f_m_bfi)) { @@ -329,25 +329,25 @@ private: low_bfi_ = CGAL::convert_to_bfi(this->low()); } if(! f_low_bfi_) { - f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); + f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value()); } if(! high_bfi_) { high_bfi_ = CGAL::convert_to_bfi(this->high()); } if(! f_high_bfi_) { - f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); + f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value()); } Integer i; while(true) { - if(CGAL::zero_in(f_low_bfi_.get() - f_high_bfi_.get())) { + if(CGAL::zero_in(f_low_bfi_.value() - f_high_bfi_.value())) { _set_prec(2*prec_); continue; } - BFI denom = f_low_bfi_.get()-f_high_bfi_.get(); + BFI denom = f_low_bfi_.value()-f_high_bfi_.value(); - BFI z = f_low_bfi_.get() / denom; + BFI z = f_low_bfi_.value() / denom; std::pair int_pair = _to_integer_interval(z,N); Integer i_low = int_pair.first; @@ -458,7 +458,7 @@ protected: f_bfi_ = _convert_polynomial_to_bfi(this->polynomial()); } - BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m)); + BFI eval = f_bfi_.value().evaluate(convert_to_bfi(m)); CGAL::Sign s = CGAL::sign(CGAL::lower(eval)); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index a52086ce117..188343887bc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -184,7 +184,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& left_v_item = td.locate(tr.left(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (std::get(&left_v_item) != nullptr) { + if (std::get_if(&left_v_item) != nullptr) { Td_active_vertex v(std::get(left_v_item)); he = v.cw_he(); } @@ -216,7 +216,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& right_v_item = td.locate(tr.right(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (std::get(&right_v_item)!= nullptr) { + if (std::get_if(&right_v_item)!= nullptr) { Td_active_vertex v(std::get(right_v_item)); he = v.cw_he(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index 9c74e4ef9d7..8f88642aed8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -3580,7 +3580,7 @@ public: // Verify the first intersection is an overlap, remove it, and // recursively call. const X_monotone_curve_2* xcv = - std::get(&(intersections.front())); + std::get_if(&(intersections.front())); if (! xcv) { CGAL_error_msg("The first intersection is not an overlap!"); return SMALLER;