From 2797f0dc33caaae126a416bf613bd11267ba3353 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 16 Feb 2020 18:13:43 +0200 Subject: [PATCH] Only issue the deprecation message when BOOST_BIND_GLOBAL_PLACEHOLDERS isn't defined --- include/boost/bind.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index 232f55b..48cc409 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -23,14 +23,25 @@ // namespace are not a good practice and this use is deprecated. // Please switch to including directly, // adding the using directive locally where appropriate. - -#include -BOOST_HEADER_DEPRECATED( "" ) +// Alternatively, the existing behavior may be preserved by defining +// the macro BOOST_BIND_GLOBAL_PLACEHOLDERS. #include +#include #ifndef BOOST_BIND_NO_PLACEHOLDERS +#if !defined(BOOST_BIND_GLOBAL_PLACEHOLDERS) + +BOOST_PRAGMA_MESSAGE( + "The practice of declaring the Bind placeholders (_1, _2, ...) " + "in the global namespace is deprecated. Please use " + " + using namespace boost::placeholders, " + "or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior." +) + +#endif + #if defined(BOOST_CLANG) # pragma clang diagnostic push # if __has_warning("-Wheader-hygiene")