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

Removal of deprecated things #1571

Open
Nerixyz opened this issue Dec 13, 2024 · 2 comments
Open

Removal of deprecated things #1571

Nerixyz opened this issue Dec 13, 2024 · 2 comments

Comments

@Nerixyz
Copy link

Nerixyz commented Dec 13, 2024

Boost 1.87.0 (specifically ASIO 1.331) breaks https://github.com/zaphoyd/websocketpp by removing io_service and more (yes, I know about Boost.Beast).

It would be great if deprecated things were annotated with [[deprecated]] so one can get compiler warnings before the things are removed. If this gets too noisy, users could define BOOST_ASIO_NO_DEPRECATION_WARNINGS2 or something similar. Explicitly opting out is much better than requiring opt-in. I'm okay with removing stuff in minor releases3, but it's important to actively notify users about it - expecting users to use BOOST_ASIO_NO_DEPRECATED or to actively check the documentation for all their used functions is not enough in my opinion, we have [[deprecated]] for a reason.

Footnotes

  1. This release is not available in this repository, only in the Boost one.

  2. Or even better: BOOST_ASIO_NO_DEPRECATION_WARNINGS_SINCE(1, 33) to disable deprecations introduced after 1.33.

  3. Ideally, the project would use semantic versioning, but I understand that this isn't possible.

@klemens-morgenstern
Copy link
Contributor

Deprecated isn't C++11 though.

@Nerixyz
Copy link
Author

Nerixyz commented Dec 14, 2024

Deprecated isn't C++11 though.

There isn't a dedicated feature-test macro for this, but testing for __cplusplus should be enough:

#if __cplusplus >= 201402L // C++ 14
  #define ASIO_DEPRECATED [[deprecated]]
  #define ASIO_DEPRECATED_X(msg) [[deprecated(msg)]]
#else
  #define ASIO_DEPRECATED
  #define ASIO_DEPRECATED_X(msg)
#endif

tbf, allowing newer deprecations ("disable deprecations after 1.xx") is a bit harder, because the macros would need to be "unrolled" i.e. there would need to be a macro for each version (e.g. ASIO_DEPRECATED_1_33).

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

No branches or pull requests

2 participants