https://github.com/luceneplusplus/LucenePlusPlus/pull/223

From: rewine <luhongxu@deepin.org>
Date: Thu, 12 Feb 2026 10:33:33 +0800
Subject: [PATCH] Fix Boost.Bind deprecation warnings with version compatibility

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.
---
 src/core/search/ParallelMultiSearcher.cpp | 5 +++++
 src/core/util/ThreadPool.cpp              | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/src/core/search/ParallelMultiSearcher.cpp b/src/core/search/ParallelMultiSearcher.cpp
index f3bf4af0..1d00b612 100644
--- a/src/core/search/ParallelMultiSearcher.cpp
+++ b/src/core/search/ParallelMultiSearcher.cpp
@@ -5,7 +5,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #include "LuceneInc.h"
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 107300  // Boost 1.73.0+
+#include <boost/bind/bind.hpp>
+#else
 #include <boost/bind.hpp>
+#endif
 #include <boost/bind/protect.hpp>
 #include "ParallelMultiSearcher.h"
 #include "_MultiSearcher.h"
diff --git a/src/core/util/ThreadPool.cpp b/src/core/util/ThreadPool.cpp
index 116f521c..ee6640b3 100644
--- a/src/core/util/ThreadPool.cpp
+++ b/src/core/util/ThreadPool.cpp
@@ -5,6 +5,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #include "LuceneInc.h"
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 107300  // Boost 1.73.0+
+#include <boost/bind/bind.hpp>
+#else
+#include <boost/bind.hpp>
+#endif
 #include "ThreadPool.h"
 
 namespace Lucene {
