Skip to content

Commit cd3854a

Browse files
authored
Merge pull request #796 from acxz/boost-bind-warn
2 parents 6d6d129 + 5a2ff19 commit cd3854a

File tree

82 files changed

+545
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+545
-221
lines changed

gtsam/base/numericalDerivative.h

+202-71
Large diffs are not rendered by default.

gtsam/geometry/tests/testCalibratedCamera.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
#include <gtsam/base/Testable.h>
2121
#include <gtsam/base/numericalDerivative.h>
2222

23+
#include <boost/bind/bind.hpp>
2324
#include <CppUnitLite/TestHarness.h>
2425

2526
#include <iostream>
2627

28+
using namespace boost::placeholders;
2729
using namespace std;
2830
using namespace gtsam;
2931

gtsam/geometry/tests/testCameraSet.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <gtsam/geometry/Pose3.h>
2121
#include <gtsam/base/numericalDerivative.h>
2222
#include <CppUnitLite/TestHarness.h>
23-
#include <boost/bind.hpp>
2423

2524
using namespace std;
2625
using namespace gtsam;

gtsam/geometry/tests/testEssentialMatrix.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
#include <gtsam/geometry/CalibratedCamera.h>
1010
#include <gtsam/base/numericalDerivative.h>
1111
#include <gtsam/base/Testable.h>
12+
13+
#include <boost/bind/bind.hpp>
1214
#include <CppUnitLite/TestHarness.h>
1315
#include <sstream>
1416

17+
using namespace boost::placeholders;
1518
using namespace std;
1619
using namespace gtsam;
1720

gtsam/geometry/tests/testOrientedPlane3.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
#include <gtsam/base/numericalDerivative.h>
2222
#include <CppUnitLite/TestHarness.h>
2323
#include <boost/assign/std/vector.hpp>
24+
#include <boost/bind/bind.hpp>
2425

2526
using namespace boost::assign;
27+
using namespace boost::placeholders;
2628
using namespace gtsam;
2729
using namespace std;
2830
using boost::none;

gtsam/geometry/tests/testPinholeCamera.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
#include <gtsam/base/Testable.h>
2323
#include <gtsam/base/numericalDerivative.h>
2424

25+
#include <boost/bind/bind.hpp>
2526
#include <CppUnitLite/TestHarness.h>
2627

2728
#include <cmath>
2829
#include <iostream>
2930

31+
using namespace boost::placeholders;
3032
using namespace std;
3133
using namespace gtsam;
3234

gtsam/geometry/tests/testPinholeSet.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <gtsam/geometry/Pose3.h>
2121
#include <gtsam/base/numericalDerivative.h>
2222
#include <CppUnitLite/TestHarness.h>
23-
#include <boost/bind.hpp>
2423

2524
using namespace std;
2625
using namespace gtsam;

gtsam/geometry/tests/testPoint3.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
#include <gtsam/geometry/Point3.h>
1818
#include <gtsam/base/Testable.h>
1919
#include <gtsam/base/numericalDerivative.h>
20+
21+
#include <boost/bind/bind.hpp>
2022
#include <CppUnitLite/TestHarness.h>
2123

24+
using namespace boost::placeholders;
2225
using namespace gtsam;
2326

2427
GTSAM_CONCEPT_TESTABLE_INST(Point3)

gtsam/geometry/tests/testPose3.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <boost/assign/std/vector.hpp> // for operator +=
2424
using namespace boost::assign;
25+
#include <boost/bind/bind.hpp>
26+
using namespace boost::placeholders;
2527

2628
#include <CppUnitLite/TestHarness.h>
2729
#include <cmath>

gtsam/geometry/tests/testSO3.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
#include <gtsam/base/Testable.h>
2121
#include <gtsam/base/testLie.h>
2222

23+
#include <boost/bind/bind.hpp>
2324
#include <CppUnitLite/TestHarness.h>
2425

26+
using namespace boost::placeholders;
2527
using namespace std;
2628
using namespace gtsam;
2729

gtsam/geometry/tests/testSimilarity3.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030

3131
#include <CppUnitLite/TestHarness.h>
3232

33+
#include <boost/bind/bind.hpp>
3334
#include <boost/function.hpp>
34-
#include <boost/bind.hpp>
3535

36+
using namespace boost::placeholders;
3637
using namespace gtsam;
3738
using namespace std;
3839
using symbol_shorthand::X;

gtsam/geometry/tests/testUnit3.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131

3232
#include <CppUnitLite/TestHarness.h>
3333

34-
#include <boost/bind.hpp>
3534
#include <boost/assign/std/vector.hpp>
35+
#include <boost/bind/bind.hpp>
3636

3737
#include <cmath>
3838
#include <random>
3939

4040
using namespace boost::assign;
41+
using namespace boost::placeholders;
4142
using namespace gtsam;
4243
using namespace std;
4344
using gtsam::symbol_shorthand::U;

gtsam/inference/EliminationTree-inst.h

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#pragma once
1919

2020
#include <boost/make_shared.hpp>
21-
#include <boost/bind.hpp>
2221
#include <stack>
2322

2423
#include <gtsam/base/timing.h>

gtsam/inference/FactorGraph-inst.h

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
#include <gtsam/inference/FactorGraph.h>
2525

26-
#include <boost/bind.hpp>
27-
2826
#include <stdio.h>
2927
#include <algorithm>
3028
#include <iostream> // for cout :-(

gtsam/inference/FactorGraph.h

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <Eigen/Core> // for Eigen::aligned_allocator
3030

3131
#include <boost/assign/list_inserter.hpp>
32-
#include <boost/bind.hpp>
3332
#include <boost/make_shared.hpp>
3433
#include <boost/serialization/nvp.hpp>
3534
#include <boost/serialization/vector.hpp>

gtsam/inference/LabeledSymbol.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
#include <iostream>
1919

20+
#include <boost/bind/bind.hpp>
2021
#include <boost/format.hpp>
21-
#include <boost/bind.hpp>
2222

2323
#include <boost/lexical_cast.hpp>
2424

@@ -110,16 +110,16 @@ bool LabeledSymbol::operator!=(gtsam::Key comp) const {
110110
static LabeledSymbol make(gtsam::Key key) { return LabeledSymbol(key);}
111111

112112
boost::function<bool(gtsam::Key)> LabeledSymbol::TypeTest(unsigned char c) {
113-
return boost::bind(&LabeledSymbol::chr, boost::bind(make, _1)) == c;
113+
return boost::bind(&LabeledSymbol::chr, boost::bind(make, boost::placeholders::_1)) == c;
114114
}
115115

116116
boost::function<bool(gtsam::Key)> LabeledSymbol::LabelTest(unsigned char label) {
117-
return boost::bind(&LabeledSymbol::label, boost::bind(make, _1)) == label;
117+
return boost::bind(&LabeledSymbol::label, boost::bind(make, boost::placeholders::_1)) == label;
118118
}
119119

120120
boost::function<bool(gtsam::Key)> LabeledSymbol::TypeLabelTest(unsigned char c, unsigned char label) {
121-
return boost::bind(&LabeledSymbol::chr, boost::bind(make, _1)) == c &&
122-
boost::bind(&LabeledSymbol::label, boost::bind(make, _1)) == label;
121+
return boost::bind(&LabeledSymbol::chr, boost::bind(make, boost::placeholders::_1)) == c &&
122+
boost::bind(&LabeledSymbol::label, boost::bind(make, boost::placeholders::_1)) == label;
123123
}
124124

125125
/* ************************************************************************* */

gtsam/inference/Symbol.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include <gtsam/inference/Symbol.h>
2020

21+
#include <boost/bind/bind.hpp>
2122
#include <boost/format.hpp>
22-
#include <boost/bind.hpp>
2323

2424
#include <limits.h>
2525
#include <list>
@@ -63,7 +63,7 @@ Symbol::operator std::string() const {
6363
static Symbol make(gtsam::Key key) { return Symbol(key);}
6464

6565
boost::function<bool(Key)> Symbol::ChrTest(unsigned char c) {
66-
return bind(&Symbol::chr, bind(make, _1)) == c;
66+
return boost::bind(&Symbol::chr, boost::bind(make, boost::placeholders::_1)) == c;
6767
}
6868

6969
GTSAM_EXPORT std::ostream &operator<<(std::ostream &os, const Symbol &symbol) {

gtsam/inference/inference-inst.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#pragma once
2121

2222
#include <boost/shared_ptr.hpp>
23-
#include <boost/bind.hpp>
2423
#include <utility>
2524

2625
#include <gtsam/base/treeTraversal-inst.h>

gtsam/linear/HessianFactor.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
#include <boost/format.hpp>
3333
#include <boost/make_shared.hpp>
3434
#include <boost/tuple/tuple.hpp>
35-
#ifdef __GNUC__
36-
#pragma GCC diagnostic push
37-
#pragma GCC diagnostic ignored "-Wunused-variable"
38-
#endif
39-
#include <boost/bind.hpp>
40-
#ifdef __GNUC__
41-
#pragma GCC diagnostic pop
42-
#endif
4335
#include <boost/assign/list_of.hpp>
4436
#include <boost/range/adaptor/transformed.hpp>
4537
#include <boost/range/adaptor/map.hpp>

gtsam/linear/JacobianFactor.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@
3535
#include <boost/format.hpp>
3636
#include <boost/make_shared.hpp>
3737
#include <boost/array.hpp>
38-
#ifdef __GNUC__
39-
#pragma GCC diagnostic push
40-
#pragma GCC diagnostic ignored "-Wunused-variable"
41-
#endif
42-
#include <boost/bind.hpp>
43-
#ifdef __GNUC__
44-
#pragma GCC diagnostic pop
45-
#endif
4638
#include <boost/range/algorithm/copy.hpp>
4739
#include <boost/range/adaptor/indirected.hpp>
4840
#include <boost/range/adaptor/map.hpp>

gtsam/linear/VectorValues.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include <gtsam/linear/VectorValues.h>
2020

21-
#include <boost/bind.hpp>
21+
#include <boost/bind/bind.hpp>
2222
#include <boost/range/combine.hpp>
2323
#include <boost/range/numeric.hpp>
2424
#include <boost/range/adaptor/transformed.hpp>
@@ -38,7 +38,8 @@ namespace gtsam {
3838
{
3939
// Merge using predicate for comparing first of pair
4040
merge(first.begin(), first.end(), second.begin(), second.end(), inserter(values_, values_.end()),
41-
boost::bind(&less<Key>::operator(), less<Key>(), boost::bind(&KeyValuePair::first, _1), boost::bind(&KeyValuePair::first, _2)));
41+
boost::bind(&less<Key>::operator(), less<Key>(), boost::bind(&KeyValuePair::first, boost::placeholders::_1),
42+
boost::bind(&KeyValuePair::first, boost::placeholders::_2)));
4243
if(size() != first.size() + second.size())
4344
throw invalid_argument("Requested to merge two VectorValues that have one or more variables in common.");
4445
}

gtsam/linear/tests/testGaussianBayesNet.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
#include <boost/tuple/tuple.hpp>
2626
#include <boost/assign/list_of.hpp>
2727
#include <boost/assign/std/list.hpp> // for operator +=
28-
using namespace boost::assign;
28+
#include <boost/bind/bind.hpp>
2929

3030
// STL/C++
3131
#include <iostream>
3232
#include <sstream>
3333

34+
using namespace boost::assign;
35+
using namespace boost::placeholders;
3436
using namespace std;
3537
using namespace gtsam;
3638

gtsam/linear/tests/testGaussianBayesTree.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
#include <boost/assign/list_of.hpp>
2222
#include <boost/assign/std/list.hpp> // for operator +=
2323
#include <boost/assign/std/set.hpp> // for operator +=
24-
using namespace boost::assign;
24+
#include <boost/bind/bind.hpp>
2525

2626
#include <gtsam/base/debug.h>
2727
#include <gtsam/base/numericalDerivative.h>
2828
#include <gtsam/linear/GaussianJunctionTree.h>
2929
#include <gtsam/linear/GaussianBayesTree.h>
3030
#include <gtsam/linear/GaussianConditional.h>
3131

32+
using namespace boost::assign;
33+
using namespace boost::placeholders;
3234
using namespace std;
3335
using namespace gtsam;
3436

gtsam/navigation/tests/testAHRSFactor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
#include <gtsam/base/debug.h>
2626
#include <CppUnitLite/TestHarness.h>
2727

28-
#include <boost/bind.hpp>
28+
#include <boost/bind/bind.hpp>
2929
#include <list>
3030

31+
using namespace boost::placeholders;
3132
using namespace std;
3233
using namespace gtsam;
3334

gtsam/navigation/tests/testAttitudeFactor.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
#include <gtsam/base/numericalDerivative.h>
2222
#include <gtsam/base/serialization.h>
2323
#include <gtsam/base/serializationTestHelpers.h>
24+
25+
#include <boost/bind/bind.hpp>
2426
#include <CppUnitLite/TestHarness.h>
2527

28+
using namespace boost::placeholders;
2629
using namespace std;
2730
using namespace gtsam;
2831

gtsam/navigation/tests/testCombinedImuFactor.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#include <CppUnitLite/TestHarness.h>
3131

32-
#include <boost/bind.hpp>
3332
#include <list>
3433

3534
#include "imuFactorTesting.h"

gtsam/navigation/tests/testGPSFactor.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
#include <gtsam/base/Testable.h>
2121
#include <gtsam/base/numericalDerivative.h>
2222

23+
#include <boost/bind/bind.hpp>
24+
2325
#include <CppUnitLite/TestHarness.h>
2426

2527
#include <GeographicLib/Config.h>
2628
#include <GeographicLib/LocalCartesian.hpp>
2729

30+
using namespace boost::placeholders;
2831
using namespace std;
2932
using namespace gtsam;
3033
using namespace GeographicLib;

gtsam/navigation/tests/testImuBias.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
#include <gtsam/base/numericalDerivative.h>
2020

2121
#include <CppUnitLite/TestHarness.h>
22-
#include <boost/bind.hpp>
22+
#include <boost/bind/bind.hpp>
2323

24+
using namespace boost::placeholders;
2425
using namespace std;
2526
using namespace gtsam;
2627

0 commit comments

Comments
 (0)