Skip to content

Remove superfluous boost includes#7384

Merged
DennisOSRM merged 2 commits intomasterfrom
dluxen/remove-superfluous-boost-includes
Feb 27, 2026
Merged

Remove superfluous boost includes#7384
DennisOSRM merged 2 commits intomasterfrom
dluxen/remove-superfluous-boost-includes

Conversation

@DennisOSRM
Copy link
Copy Markdown
Collaborator

@DennisOSRM DennisOSRM commented Feb 27, 2026

Remove boost headers that are included but whose functionality is not used in the respective translation units:

  • boost/assert.hpp: process_memory_allocator.cpp
  • boost/ref.hpp: restriction_parser.cpp, maneuver_override_relation_parser.cpp
  • boost/optional/optional.hpp: restriction_parser.cpp, extractor_callbacks.cpp, benchmarks/route.cpp, benchmarks/bench.cpp, parameters_parser.hpp, scripting_environment.hpp, restriction_parser.hpp
  • boost/optional/optional_io.hpp: routed.cpp, intersection_analysis.cpp
  • boost/numeric/conversion/cast.hpp: turn_lane_matcher.cpp, turn_lane_handler.cpp, compressed_edge_container.cpp, post_processing.cpp, extraction_turn.hpp
  • boost/algorithm/string.hpp: parsing_toolkit.hpp (only boost::tokenizer is used, which comes from the separately-included boost/tokenizer.hpp)

Issue

What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.

Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.

Was this change primarily generated using an AI tool?
Kindly make this transparent and disclose which tool / model you have been using.
Please note our contribution guidlines on the use of AI tools.

Tasklist

Requirements / Relations

Link any requirements here. Other pull requests this PR is based on?

Remove boost headers that are included but whose functionality
is not used in the respective translation units:

- boost/assert.hpp: process_memory_allocator.cpp
- boost/ref.hpp: restriction_parser.cpp, maneuver_override_relation_parser.cpp
- boost/optional/optional.hpp: restriction_parser.cpp, extractor_callbacks.cpp,
  benchmarks/route.cpp, benchmarks/bench.cpp, parameters_parser.hpp,
  scripting_environment.hpp, restriction_parser.hpp
- boost/optional/optional_io.hpp: routed.cpp, intersection_analysis.cpp
- boost/numeric/conversion/cast.hpp: turn_lane_matcher.cpp, turn_lane_handler.cpp,
  compressed_edge_container.cpp, post_processing.cpp, extraction_turn.hpp
- boost/algorithm/string.hpp: parsing_toolkit.hpp (only boost::tokenizer is used,
  which comes from the separately-included boost/tokenizer.hpp)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes Boost headers that are included but unused in multiple translation units/headers to reduce compile overhead and improve include hygiene across the OSRM backend codebase.

Changes:

  • Drop unused Boost include directives across tools, guidance, extractor, engine, and benchmark code.
  • Narrow guidance parsing includes to only the required Boost tokenizer header.
  • Remove Boost.Optional / Boost.Ref / Boost.NumericCast includes where corresponding APIs are not used.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tools/routed.cpp Removes unused boost/optional/optional_io.hpp include.
src/guidance/turn_lane_matcher.cpp Removes unused boost/numeric/conversion/cast.hpp include.
src/guidance/turn_lane_handler.cpp Removes unused boost/numeric/conversion/cast.hpp include.
src/extractor/restriction_parser.cpp Removes unused Boost.Optional and Boost.Ref includes.
src/extractor/maneuver_override_relation_parser.cpp Removes unused Boost.Ref include.
src/extractor/intersection/intersection_analysis.cpp Removes unused boost/optional/optional_io.hpp include.
src/extractor/extractor_callbacks.cpp Removes unused Boost.Optional include.
src/extractor/compressed_edge_container.cpp Removes unused boost/numeric/conversion/cast.hpp include.
src/engine/guidance/post_processing.cpp Removes unused boost/numeric/conversion/cast.hpp include.
src/engine/datafacade/process_memory_allocator.cpp Removes unused boost/assert.hpp include.
src/benchmarks/route.cpp Removes unused Boost.Optional include.
src/benchmarks/bench.cpp Removes unused Boost.Optional include.
include/server/api/parameters_parser.hpp Removes unused Boost.Optional include (but still uses std::optional).
include/guidance/parsing_toolkit.hpp Removes unused boost/algorithm/string.hpp include; keeps tokenizer include.
include/extractor/scripting_environment.hpp Removes unused Boost.Optional include.
include/extractor/restriction_parser.hpp Removes unused Boost.Optional include.
include/extractor/extraction_turn.hpp Removes unused boost/numeric/conversion/cast.hpp include.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/server/api/parameters_parser.hpp
@Claude
Copy link
Copy Markdown
Contributor

Claude AI commented Feb 27, 2026

@DennisOSRM I've opened a new pull request, #7385, to work on those changes. Once the pull request is ready, I'll request review from you.

…es (#7385)

* Initial plan

* Add <optional> and <string> includes, order alphabetically

Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DennisOSRM DennisOSRM merged commit 758197d into master Feb 27, 2026
27 checks passed
@DennisOSRM DennisOSRM deleted the dluxen/remove-superfluous-boost-includes branch February 27, 2026 22: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

Successfully merging this pull request may close these issues.

3 participants