Skip to content

Avoid deprecated bind placeholders in global namespace#92

Merged
vprus merged 1 commit into
boostorg:developfrom
mloskot:ml/avoid-bind-global-placeholders
Apr 1, 2020
Merged

Avoid deprecated bind placeholders in global namespace#92
vprus merged 1 commit into
boostorg:developfrom
mloskot:ml/avoid-bind-global-placeholders

Conversation

@mloskot

@mloskot mloskot commented Mar 6, 2020

Copy link
Copy Markdown
Member

This fixes numerous yet annoying compilation warnings:

  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.

This is somewhat related to PR #91


Apart from obscuring the output of compilation of libraries using Boost.Test, it may be troublesome on CI builds. On many CI services every line of log counts and if log dumps become too long,
builds are terminated.

@Lastique

Copy link
Copy Markdown
Member

Doesn't this PR duplicate #91 (not just relates to)? Granted, that PR does more than just silence the warnings.

@mloskot

mloskot commented Mar 31, 2020

Copy link
Copy Markdown
Member Author

Well, it does, but I assumed the PR #91 is never gonna be merged as it is a mixture of unrelated changes, actual fixes with code tidying up and formatting. So, to increase chances for the fix being merged, I submitted this focused PR.

@vprus

vprus commented Apr 1, 2020

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Since only .cpp files are affected, I would prefer if 'using namespace boost::placehoders' were at the top level. Having this twice inside specific code blocks does not seem to be useful. Would that solve the problem?

@mloskot

mloskot commented Apr 1, 2020

Copy link
Copy Markdown
Member Author

@vprus I refactored the PR as you suggest. Seems fine.

This fixes numerous compilation warnings:

  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.

@vprus vprus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good.

@vprus vprus merged commit a237942 into boostorg:develop Apr 1, 2020
@mloskot mloskot deleted the ml/avoid-bind-global-placeholders branch April 1, 2020 11:43
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.

3 participants