Remove Boost.Bind usages.

Fix build for clang.
This commit is contained in:
Georgy Guminov 2025-02-11 20:41:12 +03:00
parent 1c295e6830
commit 4aadc91f5c
4 changed files with 13 additions and 20 deletions

View File

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

View File

@ -13,7 +13,6 @@
#include <functional>
#include <limits>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
@ -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,7 +351,7 @@ namespace detail
*/
float_t policy_mcr()
{
using namespace boost::placeholders;
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);
@ -364,8 +359,8 @@ namespace detail
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))))
std::bind(std::equal_to< my_color_type >(), my_white,
std::bind(&color_map_t::operator[], vcm_, _1))))
!= vie)
/// While there are undiscovered vertices
{

View File

@ -15,7 +15,6 @@
#include <vector>
#include <algorithm>
#include <boost/config.hpp>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/sparse_ordering.hpp>
#include <boost/graph/graph_utility.hpp>
@ -49,7 +48,8 @@ namespace detail
template < typename Vertex, typename Graph >
void finish_vertex(Vertex, Graph& g)
{
using namespace boost::placeholders;
using std::placeholders::_1;
using std::placeholders::_2;
typename graph_traits< Graph >::out_edge_iterator ei, ei_end;
Vertex v, w;
@ -61,7 +61,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, std::bind(comp, _2, _1));
unsigned i = 0;

View File

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