Skip to content

Use std::span#123

Merged
ahcorde merged 5 commits into
rollingfrom
ahcorde/rolling/span
Jul 14, 2026
Merged

Use std::span#123
ahcorde merged 5 commits into
rollingfrom
ahcorde/rolling/span

Conversation

@ahcorde

@ahcorde ahcorde commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
  • std::vector to std::span
  • range for
  • designated-initializer

Claude Opus 4.7

ahcorde added 3 commits July 2, 2026 12:32
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Jul 2, 2026
@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Comment thread src/menu_handler.cpp

bool MenuHandler::pushMenuEntries(
std::vector<EntryHandle> & handles_in,
std::span<const EntryHandle> handles_in,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Normally I would flag this as having dropped the pass-by-reference, but I looked it up and apparently pass-by-value is acceptable with spans. TIL.

@asymingt asymingt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. Today I learned about std::span! The neat thing is that it supports ranges too, which I think has the potential to be super useful, because it avoids you needing to maintain iterators for ranges.

Base automatically changed from ahcorde/rolling/std_format to rolling July 14, 2026 07:01
@ahcorde

ahcorde commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Pulls: #123
Gist: https://gist.githubusercontent.com/ahcorde/96f2f5e44388b146fa27ccdeedc1f299/raw/b2511229e4149a4f45918ad8eb9db07248c5cece/ros2.repos
BUILD args: --packages-above-and-dependencies interactive_markers
TEST args: --packages-above interactive_markers
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19835

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 57bdc3b into rolling Jul 14, 2026
2 checks passed
@ahcorde ahcorde deleted the ahcorde/rolling/span branch July 14, 2026 15:59
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.

2 participants