Skip to content

Commit 9ed232c

Browse files
committed
Revert "fix boost >= 1.73 bind warnings"
This reverts commit 6276560. as this is breaking on boost < 1.73
1 parent 7e2ec97 commit 9ed232c

File tree

12 files changed

+56
-115
lines changed

12 files changed

+56
-115
lines changed

include/dynamic-graph/command-bind.h

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "dynamic-graph/command.h"
2424
#include <boost/assign/list_of.hpp>
25-
#include <boost/bind/bind.hpp>
25+
#include <boost/bind.hpp>
2626
#include <boost/function.hpp>
2727

2828
/* --- FUNCTION 0 ARGS ----------------------------------------------------- */
@@ -111,17 +111,15 @@ makeCommandVoid1(E &entity,
111111
// the template arg... why ???
112112
boost::function<void(E *, const T &)> function,
113113
const std::string &docString) {
114-
return new CommandVoid1<E, T>(
115-
entity, boost::bind(function, &entity, boost::placeholders::_1),
116-
docString);
114+
return new CommandVoid1<E, T>(entity, boost::bind(function, &entity, _1),
115+
docString);
117116
}
118117

119118
template <class E, typename T>
120119
CommandVoid1<E, T> *makeCommandVoid1(E &entity, void (E::*function)(const T &),
121120
const std::string &docString) {
122-
return new CommandVoid1<E, T>(
123-
entity, boost::bind(function, &entity, boost::placeholders::_1),
124-
docString);
121+
return new CommandVoid1<E, T>(entity, boost::bind(function, &entity, _1),
122+
docString);
125123
return NULL;
126124
}
127125

@@ -177,22 +175,16 @@ makeCommandVoid2(E &entity,
177175
// the template arg... why ???
178176
boost::function<void(E *, const T1 &, const T2 &)> function,
179177
const std::string &docString) {
180-
return new CommandVoid2<E, T1, T2>(entity,
181-
boost::bind(function, &entity,
182-
boost::placeholders::_1,
183-
boost::placeholders::_2),
184-
docString);
178+
return new CommandVoid2<E, T1, T2>(
179+
entity, boost::bind(function, &entity, _1, _2), docString);
185180
}
186181

187182
template <class E, typename T1, typename T2>
188183
CommandVoid2<E, T1, T2> *
189184
makeCommandVoid2(E &entity, void (E::*function)(const T1 &, const T2 &),
190185
const std::string &docString) {
191-
return new CommandVoid2<E, T1, T2>(entity,
192-
boost::bind(function, &entity,
193-
boost::placeholders::_1,
194-
boost::placeholders::_2),
195-
docString);
186+
return new CommandVoid2<E, T1, T2>(
187+
entity, boost::bind(function, &entity, _1, _2), docString);
196188
return NULL;
197189
}
198190

@@ -251,10 +243,7 @@ CommandVoid3<E, T1, T2, T3> *makeCommandVoid3(
251243
boost::function<void(E *, const T1 &, const T2 &, const T3 &)> function,
252244
const std::string &docString) {
253245
return new CommandVoid3<E, T1, T2, T3>(
254-
entity,
255-
boost::bind(function, &entity, boost::placeholders::_1,
256-
boost::placeholders::_2, boost::placeholders::_3),
257-
docString);
246+
entity, boost::bind(function, &entity, _1, _2, _3), docString);
258247
}
259248

260249
template <class E, typename T1, typename T2, typename T3>
@@ -263,10 +252,7 @@ makeCommandVoid3(E &entity,
263252
void (E::*function)(const T1 &, const T2 &, const T3 &),
264253
const std::string &docString) {
265254
return new CommandVoid3<E, T1, T2, T3>(
266-
entity,
267-
boost::bind(function, &entity, boost::placeholders::_1,
268-
boost::placeholders::_2, boost::placeholders::_3),
269-
docString);
255+
entity, boost::bind(function, &entity, _1, _2, _3), docString);
270256
return NULL;
271257
}
272258

@@ -331,11 +317,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
331317
function,
332318
const std::string &docString) {
333319
return new CommandVoid4<E, T1, T2, T3, T4>(
334-
entity,
335-
boost::bind(function, &entity, boost::placeholders::_1,
336-
boost::placeholders::_2, boost::placeholders::_3,
337-
boost::placeholders::_4),
338-
docString);
320+
entity, boost::bind(function, &entity, _1, _2, _3, _4), docString);
339321
}
340322

341323
template <class E, typename T1, typename T2, typename T3, typename T4>
@@ -344,11 +326,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
344326
void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &),
345327
const std::string &docString) {
346328
return new CommandVoid4<E, T1, T2, T3, T4>(
347-
entity,
348-
boost::bind(function, &entity, boost::placeholders::_1,
349-
boost::placeholders::_2, boost::placeholders::_3,
350-
boost::placeholders::_4),
351-
docString);
329+
entity, boost::bind(function, &entity, _1, _2, _3, _4), docString);
352330
return NULL;
353331
}
354332

@@ -401,9 +379,8 @@ template <class E>
401379
CommandVerbose<E> *makeCommandVerbose(E &entity,
402380
void (E::*function)(std::ostream &),
403381
const std::string &docString) {
404-
return new CommandVerbose<E>(
405-
entity, boost::bind(function, &entity, boost::placeholders::_1),
406-
docString);
382+
return new CommandVerbose<E>(entity, boost::bind(function, &entity, _1),
383+
docString);
407384
return NULL;
408385
}
409386

@@ -507,17 +484,15 @@ makeCommandReturnType1(E &entity,
507484
boost::function<ReturnType(E *, const T &)> function,
508485
const std::string &docString) {
509486
return new CommandReturnType1<E, ReturnType, T>(
510-
entity, boost::bind(function, &entity, boost::placeholders::_1),
511-
docString);
487+
entity, boost::bind(function, &entity, _1), docString);
512488
}
513489

514490
template <class E, typename ReturnType, typename T>
515491
CommandReturnType1<E, ReturnType, T> *
516492
makeCommandReturnType1(E &entity, ReturnType (E::*function)(const T &),
517493
const std::string &docString) {
518494
return new CommandReturnType1<E, ReturnType, T>(
519-
entity, boost::bind(function, &entity, boost::placeholders::_1),
520-
docString);
495+
entity, boost::bind(function, &entity, _1), docString);
521496
return NULL;
522497
}
523498

@@ -576,10 +551,7 @@ CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2(
576551
boost::function<ReturnType(E *, const T1 &, const T2 &)> function,
577552
const std::string &docString) {
578553
return new CommandReturnType2<E, ReturnType, T1, T2>(
579-
entity,
580-
boost::bind(function, &entity, boost::placeholders::_1,
581-
boost::placeholders::_2),
582-
docString);
554+
entity, boost::bind(function, &entity, _1, _2), docString);
583555
}
584556

585557
template <class E, typename ReturnType, typename T1, typename T2>
@@ -588,10 +560,7 @@ makeCommandReturnType2(E &entity,
588560
ReturnType (E::*function)(const T1 &, const T2 &),
589561
const std::string &docString) {
590562
return new CommandReturnType2<E, ReturnType, T1, T2>(
591-
entity,
592-
boost::bind(function, &entity, boost::placeholders::_1,
593-
boost::placeholders::_2),
594-
docString);
563+
entity, boost::bind(function, &entity, _1, _2), docString);
595564
return NULL;
596565
}
597566

include/dynamic-graph/signal-helper.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@
2626
#type + ")::" + #name)
2727
#define BIND_SIGNAL_TO_FUNCTION(name, IO, type) \
2828
m_##name##S##IO.setFunction(boost::bind( \
29-
&EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name), this,
30-
boost::placeholders::_1, boost::placeholders::_2));
29+
&EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name), this, _1, _2));
3130

32-
/**/
31+
/**/
3332

3433
#define DECLARE_SIGNAL_IN(name, type) \
3534
::dynamicgraph::SignalPtr<type, int> m_##name##SIN
3635
#define CONSTRUCT_SIGNAL_IN(name, type) \
3736
m_##name##SIN(NULL, getClassName() + "(" + getName() + ")::input(" + #type + \
3837
")::" + #name)
3938

40-
/**/
39+
/**/
4140

4241
#define DECLARE_SIGNAL_OUT_FUNCTION(name, type) \
4342
type &SIGNAL_OUT_FUNCTION_NAME(name)(type &, int)
@@ -56,12 +55,10 @@ protected: \
5655

5756
#define CONSTRUCT_SIGNAL_OUT(name, type, dep) \
5857
m_##name##SOUT( \
59-
boost::bind(&EntityClassName::name##SOUT_function, this, \
60-
boost::placeholders::_1, boost::placeholders::_2), \
61-
dep, \
58+
boost::bind(&EntityClassName::name##SOUT_function, this, _1, _2), dep, \
6259
getClassName() + "(" + getName() + ")::output(" + #type + ")::" + #name)
6360

64-
/**************** INNER SIGNALS *******************/
61+
/**************** INNER SIGNALS *******************/
6562
#define SIGNAL_INNER_FUNCTION_NAME(name) name##SINNER_function
6663

6764
#define DECLARE_SIGNAL_INNER_FUNCTION(name, type) \
@@ -79,9 +76,7 @@ protected: \
7976

8077
#define CONSTRUCT_SIGNAL_INNER(name, type, dep) \
8178
m_##name##SINNER( \
82-
boost::bind(&EntityClassName::name##SINNER_function, this, \
83-
boost::placeholders::_1, boost::placeholders::_2), \
84-
dep, \
79+
boost::bind(&EntityClassName::name##SINNER_function, this, _1, _2), dep, \
8580
getClassName() + "(" + getName() + ")::inner(" + #type + ")::" + #name)
8681

8782
#endif // __dynamic_graph_signal_helper_H__

include/dynamic-graph/signal-time-dependent.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ namespace dynamicgraph {
3838
: Entity (name)
3939
, signal (
4040
// Set the function that computes the signal value
41-
boost::bind (&Entity::computeSignal, this, boost::placeholders::_1,
42-
boost::placeholders::_2),
41+
boost::bind (&Entity::computeSignal, this, _1, _2),
4342
// Declare the dependencies
4443
dep1 << dep2,
4544
"signalname")

include/dynamic-graph/signal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef __SIGNAL_HH
1111
#define __SIGNAL_HH
1212

13-
#include <boost/bind/bind.hpp>
13+
#include <boost/bind.hpp>
1414
#include <boost/function.hpp>
1515

1616
#include <string>

src/traces/tracer-real-time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/* --------------------------------------------------------------------- */
1313

1414
/* DG */
15-
#include <boost/bind/bind.hpp>
15+
#include <boost/bind.hpp>
1616
#include <iomanip>
1717

1818
#include <dynamic-graph/all-commands.h>

src/traces/tracer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/* --------------------------------------------------------------------- */
1313

1414
/* DG */
15-
#include <boost/bind/bind.hpp>
15+
#include <boost/bind.hpp>
1616
#include <dynamic-graph/all-commands.h>
1717
#include <dynamic-graph/debug.h>
1818
#include <dynamic-graph/factory.h>
@@ -34,9 +34,8 @@ Tracer::Tracer(const std::string n)
3434
: Entity(n), toTraceSignals(), traceStyle(TRACE_STYLE_DEFAULT),
3535
frequency(1), basename(), suffix(".dat"), rootdir(), namesSet(false),
3636
files(), names(), play(false), timeStart(0),
37-
triger(boost::bind(&Tracer::recordTrigger, this, boost::placeholders::_1,
38-
boost::placeholders::_2),
39-
sotNOSIGNAL, "Tracer(" + n + ")::triger") {
37+
triger(boost::bind(&Tracer::recordTrigger, this, _1, _2), sotNOSIGNAL,
38+
"Tracer(" + n + ")::triger") {
4039
signalRegistration(triger);
4140

4241
/* --- Commands --- */

tests/debug-real-time-tracer.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ struct MyEntity : public dynamicgraph::Entity {
3535
explicit MyEntity(const std::string &name)
3636
: Entity(name),
3737
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
38-
m_sigdTimeDepSOUT(
39-
boost::bind(&MyEntity::update, this, boost::placeholders::_1,
40-
boost::placeholders::_2),
41-
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double"),
38+
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
39+
m_sigdSIN,
40+
"MyEntity(" + name + ")::input(double)::out_double"),
4241
m_sigdTwoTimeDepSOUT(
43-
boost::bind(&MyEntity::update, this, boost::placeholders::_1,
44-
boost::placeholders::_2),
45-
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out2double")
42+
boost::bind(&MyEntity::update, this, _1, _2), m_sigdSIN,
43+
"MyEntity(" + name + ")::input(double)::out2double")
4644

4745
{
4846
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigdTwoTimeDepSOUT);

tests/debug-tracer.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,15 @@ struct MyEntity : public dynamicgraph::Entity {
3535
explicit MyEntity(const std::string &name)
3636
: Entity(name),
3737
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
38-
m_sigdTimeDepSOUT(
39-
boost::bind(&MyEntity::update, this, boost::placeholders::_1,
40-
boost::placeholders::_2),
41-
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double"),
42-
m_sigVTimeDepSOUT(
43-
boost::bind(&MyEntity::updateVector, this, boost::placeholders::_1,
44-
boost::placeholders::_2),
45-
m_sigdSIN, "MyEntity(" + name + ")::input(vector)::out_vector"),
38+
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
39+
m_sigdSIN,
40+
"MyEntity(" + name + ")::input(double)::out_double"),
41+
m_sigVTimeDepSOUT(boost::bind(&MyEntity::updateVector, this, _1, _2),
42+
m_sigdSIN,
43+
"MyEntity(" + name + ")::input(vector)::out_vector"),
4644
m_sigdTwoTimeDepSOUT(
47-
boost::bind(&MyEntity::update, this, boost::placeholders::_1,
48-
boost::placeholders::_2),
49-
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out2double")
45+
boost::bind(&MyEntity::update, this, _1, _2), m_sigdSIN,
46+
"MyEntity(" + name + ")::input(double)::out2double")
5047

5148
{
5249
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigVTimeDepSOUT

tests/entity.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ class CustomEntity : public Entity {
4141
m_sigdSIN2(NULL,
4242
"CustomEntity(" + name + ")::input(double)::in_double"),
4343
m_sigdTimeDepSOUT(
44-
boost::bind(&CustomEntity::update, this, boost::placeholders::_1,
45-
boost::placeholders::_2),
46-
m_sigdSIN, "CustomEntity(" + name + ")::input(double)::out_double"),
44+
boost::bind(&CustomEntity::update, this, _1, _2), m_sigdSIN,
45+
"CustomEntity(" + name + ")::input(double)::out_double"),
4746
m_value(0.0) {}
4847

4948
~CustomEntity() { entityDeregistration(); }

tests/pool.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ struct MyEntity : public dynamicgraph::Entity {
3030
explicit MyEntity(const std::string &name)
3131
: Entity(name),
3232
m_sigdSIN(NULL, "MyEntity(" + name + ")::input(double)::in_double"),
33-
m_sigdTimeDepSOUT(
34-
boost::bind(&MyEntity::update, this, boost::placeholders::_1,
35-
boost::placeholders::_2),
36-
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double") {
33+
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
34+
m_sigdSIN,
35+
"MyEntity(" + name + ")::input(double)::out_double") {
3736
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT);
3837
}
3938

0 commit comments

Comments
 (0)