Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deprecated bind placeholders in global namespace #92

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Avoid deprecated bind placeholders in global namespace #92

merged 1 commit into from
Apr 1, 2020

Conversation

mloskot
Copy link
Member

@mloskot mloskot commented Mar 6, 2020

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
Member

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

@mloskot
Copy link
Member Author

mloskot commented Mar 31, 2020

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
Copy link
Collaborator

vprus commented Apr 1, 2020

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
Copy link
Member Author

mloskot commented Apr 1, 2020

@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.
Copy link
Collaborator

@vprus vprus left a comment

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