diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e294eb5b..73ba0407c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ target_link_libraries(boost_graph Boost::array Boost::assert Boost::bimap - Boost::bind Boost::concept_check Boost::config Boost::container_hash diff --git a/include/boost/graph/howard_cycle_ratio.hpp b/include/boost/graph/howard_cycle_ratio.hpp index fe6c5bd94..8163e63b3 100644 --- a/include/boost/graph/howard_cycle_ratio.hpp +++ b/include/boost/graph/howard_cycle_ratio.hpp @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -241,14 +240,10 @@ namespace detail typename graph_traits< Graph >::out_edge_iterator oei, oeie; for (boost::tie(vi, vie) = vertices(m_g); vi != vie; ++vi) { - using namespace boost::placeholders; - boost::tie(oei, oeie) = out_edges(*vi, m_g); - typename graph_traits< Graph >::out_edge_iterator mei - = boost::first_max_element(oei, oeie, - boost::bind(m_cmp, - boost::bind(&EdgeWeight1::operator[], m_ew1m, _1), - boost::bind(&EdgeWeight1::operator[], m_ew1m, _2))); + auto mei = boost::first_max_element(oei, oeie, + [this](const auto& first, const auto& second) + { return m_cmp(m_ew1m[first], m_ew1m[second]); }); if (mei == oeie) { if (m_sink == graph_traits< Graph >().null_vertex()) @@ -356,16 +351,17 @@ namespace detail */ float_t policy_mcr() { - using namespace boost::placeholders; - std::fill(m_col_bfs.begin(), m_col_bfs.end(), my_white); color_map_t vcm_ = color_map_t(m_col_bfs.begin(), m_vim); typename graph_traits< Graph >::vertex_iterator uv_itr, vie; boost::tie(uv_itr, vie) = vertices(m_g); float_t mcr = m_bound; while ((uv_itr = std::find_if(uv_itr, vie, - boost::bind(std::equal_to< my_color_type >(), my_white, - boost::bind(&color_map_t::operator[], vcm_, _1)))) + [this, &vcm_](const auto& uv) + { + return std::equal_to< my_color_type >()( + my_white, vcm_[uv]); + })) != vie) /// While there are undiscovered vertices { diff --git a/include/boost/graph/king_ordering.hpp b/include/boost/graph/king_ordering.hpp index 6a0bd9394..9f4411086 100644 --- a/include/boost/graph/king_ordering.hpp +++ b/include/boost/graph/king_ordering.hpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -49,8 +48,6 @@ namespace detail template < typename Vertex, typename Graph > void finish_vertex(Vertex, Graph& g) { - using namespace boost::placeholders; - typename graph_traits< Graph >::out_edge_iterator ei, ei_end; Vertex v, w; @@ -61,7 +58,7 @@ namespace detail reverse_iterator rbegin = Qptr->rbegin(); // heap the vertices already there - std::make_heap(rbegin, rend, boost::bind< bool >(comp, _2, _1)); + std::make_heap(rbegin, rend, [this](const auto& first, const auto& second) { return comp(second, first); }); unsigned i = 0; diff --git a/include/boost/graph/transitive_closure.hpp b/include/boost/graph/transitive_closure.hpp index 4d62379c8..bd328efd6 100644 --- a/include/boost/graph/transitive_closure.hpp +++ b/include/boost/graph/transitive_closure.hpp @@ -11,9 +11,8 @@ #include #include // for std::min and std::max -#include +#include //for std::less #include -#include #include #include #include @@ -130,16 +129,16 @@ void transitive_closure(const Graph& g, GraphTC& tc, std::vector< std::vector< cg_vertex > > CG_vec(num_vertices(CG)); for (size_type i = 0; i < num_vertices(CG); ++i) { - using namespace boost::placeholders; - typedef typename boost::graph_traits< CG_t >::adjacency_iterator cg_adj_iter; std::pair< cg_adj_iter, cg_adj_iter > pr = adjacent_vertices(i, CG); CG_vec[i].assign(pr.first, pr.second); std::sort(CG_vec[i].begin(), CG_vec[i].end(), - boost::bind(std::less< cg_vertex >(), - boost::bind(detail::subscript(topo_number), _1), - boost::bind(detail::subscript(topo_number), _2))); + [&topo_number](const auto& cg_0, const auto& cg_1) + { + return std::less< cg_vertex >()( + topo_number[cg_0], topo_number[cg_1]); + }); } std::vector< std::vector< cg_vertex > > chains; diff --git a/test/graph.cpp b/test/graph.cpp index 65c6cf92f..614fb463c 100644 --- a/test/graph.cpp +++ b/test/graph.cpp @@ -70,11 +70,8 @@ bool check_vertex_cleared(Graph& g, Vertex v, ID id) found = ai; break; } -#elif defined(BOOST_NO_CXX98_BINDERS) - found - = std::find_if(ai, aiend, std::bind(cmp, v, std::placeholders::_1)); #else - found = std::find_if(ai, aiend, std::bind1st(cmp, v)); + found = std::find_if(ai, aiend, [&v, &cmp](const auto& el) { return cmp(v, el); }); #endif if (found != aiend)