boostorg / python

Boost.org python module
http://boostorg.github.io/python
Boost Software License 1.0
468 stars 201 forks source link

Use of deprecated Bind placeholders #359

Open lukem opened 3 years ago

lukem commented 3 years ago

Some of the Boost.Python headers still use the deprecated Bind placeholders in the global namespace:

/usr/include/boost/bind.hpp:41: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.

Fix the files:

with fixes:

  1. Replace <boost/bind.hpp> and <boost/bind/placeholders.hpp> with <boost/bind/bind.hpp>
  2. Replace (global) _1 with boost::placeholders::_1
  3. Replace (global) _2 with boost::placeholders::_2
finjulhich commented 2 years ago

I see still in boost 1.76 direct inclusion of boost/bind.hpp from

boost/python/exception_translator.hpp boost/python/iterator.hpp

ijnek commented 2 years ago

315 should have fixed this, but is only available from 1.77 onwards.

@stefanseefeld Wondering if you do backports into older versions? Ubuntu22.04 uses 1.74.0 and these warnings arise in any packages that use the system libraries.

For example: https://github.com/ros-perception/vision_opencv/issues/449