Skip to content

Conversation

@idesign0
Copy link
Contributor

@idesign0 idesign0 commented Aug 10, 2025

Description

This PR fixes a compilation issue on macOS caused by the use of const std::pair<std::string, std::string> as the key type in a std::map.

Details:

  • The original code used const std::pair as the key type:
using DistanceMap = std::map<const std::pair<std::string, std::string>, std::vector<DistanceResultsData>>;
  • This caused assignment errors because std::map already treats keys as const internally.
  • Explicitly adding const leads to conflicts with internal map operations and strict compiler checks.
  • The fix removes the explicit const qualifier from the key type:
using DistanceMap = std::map<std::pair<std::string, std::string>, std::vector<DistanceResultsData>>;
  • This change ensures compatibility across platforms, including macOS, and adheres to the C++ standard container usage best practices.

[Fix] Use cross-platform <cstddef> instead of <types.h>

Description

Replaces the non-standard <types.h> header with the standard <cstddef> to ensure size_t is available on all platforms. This fixes compilation issues on macOS while remaining compatible with Linux and other platforms.

Changes

- #include <types.h>
+ #include <cstddef>  // for size_t, cross-platform

Copy link
Contributor

@forrest-rm forrest-rm left a comment

Choose a reason for hiding this comment

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

Looks simple enough

@idesign0
Copy link
Contributor Author

Looks simple enough
can you push it further? :)

@github-actions
Copy link

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Oct 13, 2025
@idesign0 idesign0 changed the title Fix: Remove explicit const from std::map key type to prevent assignment errors on macOS [Fix][Cross-Platform] Replace <types.h> with <cstddef> and remove explicit const from std::map key for macOS Nov 21, 2025
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.22%. Comparing base (f6acd91) to head (a2e8c3e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3548      +/-   ##
==========================================
+ Coverage   46.17%   46.22%   +0.06%     
==========================================
  Files         720      720              
  Lines       59179    59175       -4     
  Branches     7595     7596       +1     
==========================================
+ Hits        27320    27348      +28     
+ Misses      31692    31660      -32     
  Partials      167      167              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rhaschke rhaschke merged commit c639959 into moveit:main Nov 22, 2025
9 of 10 checks passed
@github-project-automation github-project-automation bot moved this to ✅ Done in MoveIt Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Inactive issues and PRs are marked as stale and may be closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants