2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-19 04:12:11 +00:00

Remove all std::bind usages.

This commit is contained in:
Georgy Guminov
2025-02-15 18:31:35 +03:00
parent 4aadc91f5c
commit 2d182cff02
4 changed files with 13 additions and 18 deletions

View File

@@ -351,16 +351,17 @@ namespace detail
*/
float_t policy_mcr()
{
using std::placeholders::_1;
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,
std::bind(std::equal_to< my_color_type >(), my_white,
std::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
{

View File

@@ -48,9 +48,6 @@ namespace detail
template < typename Vertex, typename Graph >
void finish_vertex(Vertex, Graph& g)
{
using std::placeholders::_1;
using std::placeholders::_2;
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, std::bind(comp, _2, _1));
std::make_heap(rbegin, rend, [this](const auto& first, const auto& second) { return comp(second, first); });
unsigned i = 0;

View File

@@ -11,7 +11,7 @@
#include <vector>
#include <algorithm> // for std::min and std::max
#include <functional>
#include <functional> //for std::less
#include <boost/config.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
@@ -129,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 std::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(),
std::bind(std::less< cg_vertex >(),
std::bind(detail::subscript(topo_number), _1),
std::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;

View File

@@ -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)