Skip to content

Commit a237942

Browse files
mloskotvprus
authored andcommitted
Avoid deprecated bind placeholders in global namespace
This fixes numerous compilation warnings: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
1 parent fcffe08 commit a237942

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/cmdline.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <boost/program_options/positional_options.hpp>
1616
#include <boost/throw_exception.hpp>
1717

18-
#include <boost/bind.hpp>
18+
#include <boost/bind/bind.hpp>
1919

2020
#include <string>
2121
#include <utility>
@@ -29,6 +29,8 @@
2929

3030
#include <iostream>
3131

32+
using namespace boost::placeholders;
33+
3234
namespace boost { namespace program_options {
3335

3436
using namespace std;

src/convert.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#include <boost/program_options/detail/utf8_codecvt_facet.hpp>
2020
#include <boost/throw_exception.hpp>
2121

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

2424
using namespace std;
25+
using namespace boost::placeholders;
2526

2627
namespace boost { namespace detail {
2728

src/parsers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <boost/program_options/environment_iterator.hpp>
1717
#include <boost/program_options/detail/convert.hpp>
1818

19-
#include <boost/bind.hpp>
19+
#include <boost/bind/bind.hpp>
2020
#include <boost/throw_exception.hpp>
2121

2222
#include <cctype>
@@ -61,6 +61,7 @@ extern char** environ;
6161
#endif
6262

6363
using namespace std;
64+
using namespace boost::placeholders;
6465

6566
namespace boost { namespace program_options {
6667

0 commit comments

Comments
 (0)