Skip to content

Conversation

@wineee
Copy link
Contributor

@wineee wineee commented Feb 12, 2026

Replace deprecated boost/bind.hpp with boost/bind/bind.hpp and use boost::placeholders namespace instead of global placeholders.

This fixes deprecation warnings in Boost 1.73.0 and later versions.

In file included from /nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/include/boost/smart_ptr/detail/deprecated_macros.hpp:8,
                 from /nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/include/boost/smart_ptr/detail/sp_counted_base.hpp:22,
                 from /nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/include/boost/smart_ptr/detail/shared_count.hpp:22,
                 from /nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from /nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/include/boost/shared_ptr.hpp:17,
                 from /build/source/include/lucene++/Lucene.h:27,
                 from /build/source/src/core/include/LuceneInc.h:23,
                 from /build/source/build/src/core/cotire/lucene++_CXX_prefix.cxx:4,
                 from /build/source/build/src/core/cotire/lucene++_CXX_prefix.hxx:4:
/nix/store/074p1j77fjfk52951r6x3l4kq2i62p67-boost-1.87.0-dev/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(
      | ^~~~~~~~~~~~~~~~~~~~
[ 50%] Building CXX object src/

Use conditional compilation to support both old and new Boost.Bind API:
- Boost >= 1.73.0: Use boost/bind/bind.hpp
- Boost < 1.73.0: Use boost/bind.hpp

This approach maintains backward compatibility while fixing deprecation
warnings in newer Boost versions.
@wineee
Copy link
Contributor Author

wineee commented Feb 12, 2026

Did not add using namespace boost::placeholders, because placeholders are not actually used in the code.

@alanw alanw merged commit 29fcfed into luceneplusplus:master Feb 13, 2026
@wineee wineee deleted the bind branch February 13, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants