diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index 470420162a7..613d08c174b 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -26,7 +26,6 @@ #include #include -#include /// \file AABB_traits.h @@ -274,13 +273,13 @@ public: switch(Traits::longest_axis(bbox)) { case AT::CGAL_AXIS_X: // sort along x - std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits)); + std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_x(p1, p2, this->m_traits); }); break; case AT::CGAL_AXIS_Y: // sort along y - std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits)); + std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_y(p1, p2, this->m_traits); }); break; case AT::CGAL_AXIS_Z: // sort along z - std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits)); + std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_z(p1, p2, this->m_traits); }); break; default: CGAL_error(); diff --git a/Generator/include/CGAL/random_convex_set_2.h b/Generator/include/CGAL/random_convex_set_2.h index a118503b4c3..56313839e55 100644 --- a/Generator/include/CGAL/random_convex_set_2.h +++ b/Generator/include/CGAL/random_convex_set_2.h @@ -23,7 +23,6 @@ #include #include #include -#include namespace CGAL { @@ -80,7 +79,7 @@ random_convex_set_2( std::size_t n, points.begin(), points.end(), points.begin(), - boost::bind2nd( Sum(), scale( centroid, FT( -1)))); + [¢roid, &sum, &scale](const Point_2& p) { return sum(p, scale(centroid, FT( -1))); }); // sort them according to their direction's angle // w.r.t. the positive x-axis: @@ -102,8 +101,7 @@ random_convex_set_2( std::size_t n, points.begin(), points.end(), points.begin(), - boost::bind2nd( Sum(), sum( centroid, - scale( new_centroid, FT( -1))))); + [¢roid, &sum, &scale](const Point_2& p) { return sum(p, scale(centroid, FT( -1))); }); // compute maximal coordinate: FT maxcoord( max_coordinate( @@ -118,7 +116,7 @@ random_convex_set_2( std::size_t n, points.begin(), points.end(), o, - boost::bind2nd( Scale(), FT( pg.range()) / maxcoord)); + [&pg, &maxcoord, &scale](const Point_2& p){ return scale(p, FT( pg.range()) / maxcoord); }); } // random_convex_set_2( n, o, pg, t) diff --git a/Matrix_search/include/CGAL/sorted_matrix_search.h b/Matrix_search/include/CGAL/sorted_matrix_search.h index 8d2cf105ffb..dd21234b4f5 100644 --- a/Matrix_search/include/CGAL/sorted_matrix_search.h +++ b/Matrix_search/include/CGAL/sorted_matrix_search.h @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -254,10 +253,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) std::nth_element(active_cells.begin(), active_cells.begin() + upper_median_rank, active_cells.end(), - boost::bind( - t.compare_strictly(), - boost::bind(Cell_min(), _1), - boost::bind(Cell_min(), _2))); + [&t](const Cell& c1, const Cell& c2) + { + return t.compare_strictly()(Cell_min()(c1), Cell_min()(c2)); + }); Cell_iterator lower_median_cell = active_cells.begin() + upper_median_rank; @@ -267,10 +266,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) std::nth_element(active_cells.begin(), active_cells.begin() + lower_median_rank, active_cells.end(), - boost::bind( - t.compare_strictly(), - boost::bind(Cell_max< Cell >(ccd), _1), - boost::bind(Cell_max< Cell >(ccd), _2))); + [&t, &ccd](const Cell& c1, const Cell& c2) + { + return t.compare_strictly()(Cell_max< Cell >(ccd)(c1), Cell_max< Cell >(ccd)(c2)); + }); Cell_iterator upper_median_cell = active_cells.begin() + lower_median_rank; @@ -282,10 +281,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) lower_median_cell = find_if(active_cells.begin(), active_cells.end(), - boost::bind( - equal_to< Value >(), - lower_median, - boost::bind(Cell_min< Cell >(), _1))); + [&lower_median](const Cell& c) + { + return equal_to< Value >()(lower_median, Cell_min< Cell >()(c)); + }); CGAL_optimisation_assertion(lower_median_cell != active_cells.end()); // ------------------------------------------------------ // test feasibility of medians and remove cells accordingly: @@ -318,10 +317,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) remove_if( active_cells.begin() + 1, active_cells.end(), - boost::bind( - t.compare_non_strictly(), - min_median, - boost::bind(Cell_min< Cell >(), _1))); + [&t, &min_median](const Cell& c) + { + return t.compare_non_strictly()(min_median, Cell_min< Cell >()(c)); + }); } // lower_median and upper_median are feasible else { // lower_median is feasible, but upper_median is not @@ -337,16 +336,11 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) remove_if( active_cells.begin() + 1, active_cells.end(), - boost::bind( - logical_or< bool >(), - boost::bind( - t.compare_non_strictly(), - lower_median, - boost::bind(Cell_min< Cell >(), _1)), - boost::bind( - t.compare_non_strictly(), - boost::bind(Cell_max< Cell >( ccd), _1), - upper_median))); + [&t, &lower_median, &upper_median, &ccd](const Cell& c) + { + return t.compare_non_strictly()(lower_median, Cell_min< Cell >()(c)) || + t.compare_non_strictly()(Cell_max< Cell >(ccd)(c), upper_median); + }); } // lower_median is feasible, but upper_median is not else @@ -364,16 +358,11 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) remove_if( active_cells.begin() + 1, active_cells.end(), - boost::bind( - logical_or< bool >(), - boost::bind( - t.compare_non_strictly(), - upper_median, - boost::bind(Cell_min< Cell >(), _1)), - boost::bind( - t.compare_non_strictly(), - boost::bind(Cell_max< Cell >( ccd), _1), - lower_median))); + [&t, &lower_median, &upper_median, &ccd](const Cell& c) + { + return t.compare_non_strictly()(upper_median, Cell_min()(c)) || + t.compare_non_strictly()(Cell_max(ccd)(c),lower_median); + }); } // upper_median is feasible, but lower_median is not else { // both upper_median and lower_median are infeasible @@ -385,11 +374,11 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) remove_if( active_cells.begin(), active_cells.end(), - boost::bind( - t.compare_non_strictly(), - boost::bind(Cell_max< Cell >( ccd), _1), - max BOOST_PREVENT_MACRO_SUBSTITUTION ( lower_median, upper_median))); - + [&t, &ccd, &lower_median, &upper_median](const Cell& c) + { + return t.compare_non_strictly()(Cell_max( ccd)(c), + max BOOST_PREVENT_MACRO_SUBSTITUTION ( lower_median, upper_median)); + }); } // both upper_median and lower_median are infeasible active_cells.erase( new_end, active_cells.end()); diff --git a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp index af9d062c74f..999babe16fd 100644 --- a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp +++ b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp @@ -16,6 +16,8 @@ #include #include +#include + template < class Matrix_iterator, class Value > Value compute_upper_bound( Matrix_iterator f, diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h index e2936def38a..5adacb71a4f 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h @@ -17,7 +17,6 @@ #include #include -#include #include #include #if BOOST_VERSION == 106000 @@ -2018,12 +2017,12 @@ bool Straight_skeleton_builder_2::FinishUp() std::for_each( mSplitNodes.begin() ,mSplitNodes.end () - ,boost::bind(&Straight_skeleton_builder_2::MergeSplitNodes,this,_1) + ,[this](Vertex_handle_pair p){ this->MergeSplitNodes(p); } ) ; std::for_each( mDanglingBisectors.begin() ,mDanglingBisectors.end () - ,boost::bind(&Straight_skeleton_builder_2::EraseBisector,this,_1) + ,[this](Halfedge_handle db){ this->EraseBisector(db); } ) ; // MergeCoincidentNodes() locks all extremities of halfedges that have a vertex involved in a multinode. diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 4e4c5606545..df69bf1f1b6 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -53,7 +53,6 @@ #include #include -#include #include #include #include @@ -7294,22 +7293,10 @@ operator==(const Triangulation_3& t1, std::vector V2 (t2.points_begin(), t2.points_end()); std::sort(V1.begin(), V1.end(), - boost::bind( - cmp1, - boost::bind< - typename boost::result_of::type>(cp, _1), - boost::bind< - typename boost::result_of::type>(cp, _2)) - == SMALLER); + [&cmp1, &cp](const Point& p1, const Point& p2){ return cmp1(cp(p1), cp(p2))==SMALLER; }); std::sort(V2.begin(), V2.end(), - boost::bind( - cmp2, - boost::bind< - typename boost::result_of::type>(cp, _1), - boost::bind< - typename boost::result_of::type>(cp, _2)) - == SMALLER); + [&cmp2, &cp](const Point& p1, const Point& p2){ return cmp2(cp(p1), cp(p2))==SMALLER; }); return V1 == V2; }