From d3a16b702230534f7265613a73204bdb051a458e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 16 Oct 2019 16:21:19 -0700 Subject: uhd: Replace all occurrences of boost::bind with std::bind Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include , and makes sure all usages of std::bind have an #include . clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit. --- host/lib/include/uhdlib/experts/expert_factory.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'host/lib/include/uhdlib/experts') diff --git a/host/lib/include/uhdlib/experts/expert_factory.hpp b/host/lib/include/uhdlib/experts/expert_factory.hpp index e7164e00e..9e07aa47f 100644 --- a/host/lib/include/uhdlib/experts/expert_factory.hpp +++ b/host/lib/include/uhdlib/experts/expert_factory.hpp @@ -8,13 +8,14 @@ #ifndef INCLUDED_UHD_EXPERTS_EXPERT_FACTORY_HPP #define INCLUDED_UHD_EXPERTS_EXPERT_FACTORY_HPP -#include -#include #include +#include #include -#include +#include +#include #include + namespace uhd { namespace experts { /*! @@ -94,8 +95,8 @@ namespace uhd { namespace experts { data_node_t* node_ptr = new data_node_t(name, init_val, &container->resolve_mutex()); prop.set(init_val); - prop.add_desired_subscriber(boost::bind(&data_node_t::commit, node_ptr, _1)); - prop.set_publisher(boost::bind(&data_node_t::retrieve, node_ptr)); + prop.add_desired_subscriber(std::bind(&data_node_t::commit, node_ptr, std::placeholders::_1)); + prop.set_publisher(std::bind(&data_node_t::retrieve, node_ptr)); container->add_data_node(node_ptr, mode); return prop; } @@ -161,8 +162,8 @@ namespace uhd { namespace experts { new data_node_t(coerced_name, init_val, &container->resolve_mutex()); prop.set(init_val); prop.set_coerced(init_val); - prop.add_desired_subscriber(boost::bind(&data_node_t::commit, desired_node_ptr, _1)); - prop.set_publisher(boost::bind(&data_node_t::retrieve, coerced_node_ptr)); + prop.add_desired_subscriber(std::bind(&data_node_t::commit, desired_node_ptr, std::placeholders::_1)); + prop.set_publisher(std::bind(&data_node_t::retrieve, coerced_node_ptr)); container->add_data_node(desired_node_ptr, auto_resolve_desired ? AUTO_RESOLVE_ON_WRITE : AUTO_RESOLVE_OFF); -- cgit v1.2.3