Skip to content

Commit

Permalink
Merge pull request #337 from odin-detector/placeholders_redux
Browse files Browse the repository at this point in the history
Fix boost::placeholder workaround missed in ParamContainer
  • Loading branch information
timcnicholls authored Mar 4, 2024
2 parents 627e156 + 0e37a78 commit f73a290
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cpp/common/include/ParamContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include <boost/function.hpp>
#include <boost/bind/bind.hpp>

#ifdef BOOST_HAS_PLACEHOLDERS
using namespace boost::placeholders;
#endif

namespace OdinData
{

Expand Down Expand Up @@ -127,12 +131,12 @@ class ParamContainer
{
// Bind the parameter into the setter function map
setter_map_[path] = boost::bind(
&ParamContainer::param_set<T>, this, boost::ref(param), boost::placeholders::_1
&ParamContainer::param_set<T>, this, boost::ref(param), _1
);

// Bind the parameter into the getter function map
getter_map_[path] = boost::bind(
&ParamContainer::param_get<T>, this, boost::ref(param), boost::placeholders::_1
&ParamContainer::param_get<T>, this, boost::ref(param), _1
);

}
Expand All @@ -151,14 +155,12 @@ class ParamContainer
{
// Bind the vector parameter into the setter function map
setter_map_[path] = boost::bind(
&ParamContainer::vector_param_set<T>, this, boost::ref(param),
boost::placeholders::_1
&ParamContainer::vector_param_set<T>, this, boost::ref(param), _1
);

// Bind the vector parameter into the getter function map
getter_map_[path] = boost::bind(
&ParamContainer::vector_param_get<T>, this, boost::ref(param),
boost::placeholders::_1
&ParamContainer::vector_param_get<T>, this, boost::ref(param), _1
);
}

Expand Down

0 comments on commit f73a290

Please sign in to comment.