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

Why was boost::asio::ip::address::to_string() marked as deprecated? #1573

Open
deniskovalchuk opened this issue Dec 17, 2024 · 2 comments
Open

Comments

@deniskovalchuk
Copy link

Hi!

I noticed that the boost::asio::ip::address::to_string(error_code & ec) was marked as deprecated and removed in Boost 1.87.0.

Could you explain the reasoning behind its deprecation? Is there a recommended alternative to achieve the same functionality?

Thanks!

@klemens-morgenstern
Copy link
Contributor

It's literally in the docs you pointed to. use the overload without &ec, most likely because it never produces an error.

@deniskovalchuk
Copy link
Author

Sorry, I didn't explain that clearly.

Is there a recommended alternative to achieve the same functionality?

I meant the boost::system::system_error exception-free behavior.

use the overload without &ec, most likely because it never produces an error.

From what I see, it does:

asio::detail::throw_error(ec);

Of course, I can just explicitly use a try-catch block for the exception, but I'm more interested in understanding the reason behind the method's deprecation.

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