Fix Boost bind deprecation warning
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 30 Dec 2025 20:32:14 +0000 (21:32 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 11:09:24 +0000 (12:09 +0100)
Original warning:
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.’

Use <boost/bind/bind.hpp> with boost::placeholders for Boost 1.46+.
Fall back to <boost/bind.hpp> for Boost 1.44 (no deprecation warning in that version).

configlib/i2n_global_config.hpp

index f61d099..a1bfaa8 100644 (file)
@@ -54,7 +54,12 @@ on this file might be covered by the GNU General Public License.
 #include <boost/static_assert.hpp>
 #include <boost/type_traits.hpp>
 #include <boost/function.hpp>
+#if BOOST_VERSION >= 104600
+#include <boost/bind/bind.hpp>
+using namespace boost::placeholders;
+#else
 #include <boost/bind.hpp>
+#endif
 #include <boost/foreach.hpp>