Replace boost::asio::io_service with boost::asio::io_context for boost 1.88 compatibility - #84
Replace boost::asio::io_service with boost::asio::io_context for boost 1.88 compatibility#84traversaro wants to merge 2 commits into
Conversation
…t 1.88 compatibility
Summary of ChangesHello @traversaro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the project's dependency on Boost.Asio by migrating from the deprecated Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly replaces the deprecated boost::asio::io_service with boost::asio::io_context to ensure compatibility with newer versions of Boost. The changes are applied consistently across the codebase. My review includes a few minor suggestions to update the corresponding Doxygen comments in header files for consistency, which will improve code documentation and maintainability.
| */ | ||
|
|
||
| LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_service & io); | ||
| LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_context & io); |
| * @param io Boost ASIO IO Service to use when creating the serial port object | ||
| */ | ||
| explicit LFCDLaser(boost::asio::io_service & io); | ||
| explicit LFCDLaser(boost::asio::io_context & io); |
| * @param io Boost ASIO IO Service to use when creating the serial port object | ||
| */ | ||
| LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_service & io); | ||
| LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_context & io); |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the codebase to be compatible with Boost 1.88 by replacing the deprecated boost::asio::io_service typedef with boost::asio::io_context. The io_service typedef was deprecated and has been removed in Boost 1.88, while io_context has been the canonical name since Boost 1.67, making this change backward compatible.
Changes:
- Replaced all instances of
boost::asio::io_servicewithboost::asio::io_contextacross source files, headers, and applications - Updated constructor signatures and member variable declarations to use
io_context - Ensured consistency between header declarations and implementation definitions
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/hlds_laser_segment_publisher.cpp | Updated constructor parameter and local variable from io_service to io_context |
| src/hlds_laser_publisher.cpp | Updated constructor parameter and local variable from io_service to io_context |
| include/hls_lfcd_lds_driver/lfcd_laser.hpp | Updated constructor parameter type in declaration from io_service to io_context |
| include/hls_lfcd_lds_driver/hlds_laser_segment_publisher.hpp | Updated constructor parameter type in declaration from io_service to io_context |
| applications/lds_polar_graph/lds_polar_graph.hpp | Updated member variable type from io_service to io_context |
| applications/lds_driver/lds_driver.hpp | Updated constructor parameter type in declaration from io_service to io_context |
| applications/lds_driver/lds_driver.cpp | Updated constructor parameter and local variable from io_service to io_context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Silvio Traversaro <silvio@traversaro.it>
boost::asio::io_serviceis just a deprecated typedef ofboost::asio::io_context, at least since boost 1.67 (see https://github.com/boostorg/asio/blob/boost-1.67.0/include/boost/asio/io_service.hpp#L27), the boost version used in apt in Ubuntu 20.04 (see https://repology.org/project/boost/versions)The
boost::asio::io_servicetypedef was removed in Boost 1.88, and this if fixed in this PR by replacingboost::asio::io_servicewithboost::asio::io_context, that is perfectly back-compatible asboost::asio::io_servicewas just a typedef forboost::asio::io_context.