diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h index a26b6d85ff5..87da66d321d 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h @@ -26,22 +26,27 @@ namespace CGAL { typedef CGAL::cpp11::tuple SmallerEqTuple; + template + struct MinMaxTuple { + typedef CGAL::cpp11::tuple Type; + }; + Compare_x_2 compare_x_2; Compare_y_2 compare_y_2; Orientation_Linf_2_Type orientation_Linf; template - inline void minmax( - const E &p, const E &q, const E &r, - Point_2 const * & min_p, Point_2 const * & max_p, - bool & samepq, bool & samepr, bool & sameqr - ) const + inline typename MinMaxTuple::Type + minmax(const E &p, const E &q, const E &r) const { Compare cmp; - samepq = false; - samepr = false; - sameqr = false; + E const * min_p (NULL); + E const * max_p (NULL); + bool samepq = false; + bool samepr = false; + bool sameqr = false; const Comparison_result cmppq = cmp(p, q); switch(cmppq) { case SMALLER: @@ -132,6 +137,8 @@ namespace CGAL { CGAL_assertion(max_p != NULL); CGAL_SDG_DEBUG(std::cout << "debug minmax cmppq=" << cmppq << " cmppr=" << cmppr << " cmpqr=" << cmpqr << std::endl; ); + return CGAL::cpp11::make_tuple( + min_p, max_p, samepq, samepr, sameqr); } inline SmallerEqTuple analyze_smalleq( @@ -177,25 +184,25 @@ namespace CGAL { CGAL_assertion(orientation_Linf(p,q,r) != DEGENERATE); + typedef typename MinMaxTuple::Type PointMinMaxTuple; + //compute the minimum x and maximum x - Point_2 const * lft_p (NULL); - Point_2 const * rgt_p (NULL); - bool samex_pq (false); - bool samex_pr (false); - bool samex_qr (false); - minmax(p, q, r, - lft_p, rgt_p, samex_pq, samex_pr, samex_qr); + PointMinMaxTuple tupx = minmax(p, q, r); + Point_2 const * lft_p = CGAL::cpp11::get<0>(tupx); + Point_2 const * rgt_p = CGAL::cpp11::get<1>(tupx); + const bool samex_pq = CGAL::cpp11::get<2>(tupx); + const bool samex_pr = CGAL::cpp11::get<3>(tupx); + const bool samex_qr = CGAL::cpp11::get<4>(tupx); CGAL_assertion(lft_p != NULL); CGAL_assertion(rgt_p != NULL); //compute the minimum y and maximum y - Point_2 const * bot_p (NULL); - Point_2 const * top_p (NULL); - bool samey_pq (false); - bool samey_pr (false); - bool samey_qr (false); - minmax(p, q, r, - bot_p, top_p, samey_pq, samey_pr, samey_qr); + PointMinMaxTuple tupy = minmax(p, q, r); + Point_2 const * bot_p = CGAL::cpp11::get<0>(tupy); + Point_2 const * top_p = CGAL::cpp11::get<1>(tupy); + const bool samey_pq = CGAL::cpp11::get<2>(tupy); + const bool samey_pr = CGAL::cpp11::get<3>(tupy); + const bool samey_qr = CGAL::cpp11::get<4>(tupy); CGAL_assertion(bot_p != NULL); CGAL_assertion(top_p != NULL);