Repository: ledger/ledger (language: cpp)

Issue:
Compilation messages with latest boost
Lots of new messages like this coming up:

```
In file included from /usr/include/boost/bind.hpp:30,
                 from /ledger-3.3.2/build/system.hh:139,
                 from /ledger-3.3.2/src/ptree.cc:32:
/usr/include/boost/bind.hpp:36:1: 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.’
   36 | BOOST_PRAGMA_MESSAGE(
```


Discussion / hints:
Is this an error or a warning?  I assume a warning since you changed the title.

Which version of boost?
Thanks for reporting, @mkschreder.

What you are seeing might be related to https://github.com/boostorg/python/issues/359. Checking Ledger's source there are a few uses of `_1` and `_2`:

```
grep -cR ' _[12]' src | grep '[^0]$'
src/op.h:1
src/account.h:2
src/py_commodity.cc:4
src/option.h:2
src/filters.h:1
```

When I build ledger using the [Ledger flake.nix](https://github.com/ledger/ledger/blob/master/flake.nix) and change it to use Boost 1.81 I do not see any compilation warnings. Until I've figured out how to make the build more verbose it would be helpful to learn more details about how you build ledger specifically, so that I could try and reproduce that on my machine.
@mkschreder mind trying out the patch below to see if that removes the messages?

Unfortunately I'm currently unable to build Ledger with boost <1.75 to verify that the patch maintains backwards compatibility.

[boost-bind.patch](https://github.com/ledger/ledger/files/11190732/boost-bind.patch)

To apply the patch the following command can be run from within the ledger workspace directory:
`% curl -sL https://github.com/ledger/ledger/files/11190732/boost-bind.patch | patch -p1`

Friendly ping for @mkschreder on this :)

Fix patch:
diff --git a/src/account.h b/src/account.h
index be8fddaf6..7ea0e2691 100644
--- a/src/account.h
+++ b/src/account.h
@@ -45,6 +45,8 @@
 
 namespace ledger {
 
+using namespace boost::placeholders;
+
 class account_t;
 class xact_t;
 class post_t;
diff --git a/src/filters.h b/src/filters.h
index 6a4e6cf4c..18bf912d5 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -49,6 +49,8 @@
 
 namespace ledger {
 
+using namespace boost::placeholders;
+
 //////////////////////////////////////////////////////////////////////
 //
 // Posting collector
diff --git a/src/op.h b/src/op.h
index dcb0784d0..2fc87a716 100644
--- a/src/op.h
+++ b/src/op.h
@@ -45,6 +45,8 @@
 
 namespace ledger {
 
+using namespace boost::placeholders;
+
 class expr_t::op_t : public noncopyable
 {
   friend class expr_t;
diff --git a/src/option.h b/src/option.h
index 35b1c893e..274d0a958 100644
--- a/src/option.h
+++ b/src/option.h
@@ -47,6 +47,8 @@
 
 namespace ledger {
 
+using namespace boost::placeholders;
+
 class call_scope_t;
 
 template <typename T>
diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index 3ae6801f7..4eb6aca44 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -42,6 +42,7 @@ namespace ledger {
 using namespace flags;
 using namespace python;
 using namespace boost::python;
+using namespace boost::placeholders;
 
 namespace {
 
diff --git a/src/system.hh.in b/src/system.hh.in
index 95dedbc2f..10086d237 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -131,7 +131,7 @@
 
 #include <boost/algorithm/string.hpp>
 #include <boost/any.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
 #include <boost/cast.hpp>
 #include <boost/current_function.hpp>
 


Test patch: