You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2022/11/07 08:55:00 UTC

[jira] [Comment Edited] (QPID-8605) Compilation prints annoying deprecation message from Boost many times: declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated

    [ https://issues.apache.org/jira/browse/QPID-8605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622870#comment-17622870 ] 

Jiri Daněk edited comment on QPID-8605 at 11/7/22 8:54 AM:
-----------------------------------------------------------

There is autofix in clang-tidy: Prefer a lambda to boost-bind https://clang.llvm.org/extra/clang-tidy/checks/modernize/avoid-bind.html. If this is applied, it will resolve the warnings. C++11 is required for the lambdas. Or maybe C++14 for some features https://stackoverflow.com/questions/17363003/why-use-stdbind-over-lambdas-in-c14. The result is not often pretty to read.

The message just wants us to use different import and add {{using namespace boost::placeholders}} at top of file.

Or {{add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)}}, maybe add_compile_definitions, something like that.


was (Author: jdanek):
There is autofix in clang-tidy: Prefer a lambda to boost-bind https://clang.llvm.org/extra/clang-tidy/checks/modernize/avoid-bind.html. If this is applied, it will resolve the warnings. C++11 is required for the lambdas. Or maybe C++14 for some features https://stackoverflow.com/questions/17363003/why-use-stdbind-over-lambdas-in-c14. The result is not often pretty to read.

The message just wants us to add {{using namespace boost::placeholders}} at top of file.

Or {{dd_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)}}

> Compilation prints annoying deprecation message from Boost many times: declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-8605
>                 URL: https://issues.apache.org/jira/browse/QPID-8605
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Build
>    Affects Versions: qpid-cpp-1.40.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> https://github.com/jiridanek/qpid-cpp/actions/runs/3308231051/jobs/5460459408#step:12:104
> {noformat}
> C:\vcpkg\installed\x64-windows\include\boost/bind.hpp(41): 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. [D:\a\qpid-cpp\qpid-cpp\BLD\src\qpidcommon.vcxproj]
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org