Add initializer_list support to Buffer class - #2
Open
karsten-nvidia wants to merge 3 commits into
Open
karsten-nvidia wants to merge 3 commits into
karsten-nvidia wants to merge 3 commits into
Conversation
Replace deprecated ament_target_dependencies() with modern CMake target_link_libraries() using namespace targets (rmw::rmw, rosidl_runtime_cpp::rosidl_runtime_cpp, pluginlib::pluginlib). This pattern aligns with other modern ROS 2 packages (pluginlib, class_loader) and resolves build issues when ament_cmake is used without ament_cmake_ros. Changes: - Line 33: target_link_libraries(PUBLIC) instead of ament_target_dependencies() - Line 73: Same pattern for test target Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Generated code tries to initialize Buffer fields using brace-enclosed initializer lists, but Buffer class was missing the necessary constructor and assignment operator. Added: - Constructor: Buffer(std::initializer_list<T>) - Assignment operator: operator=(std::initializer_list<T>) Both operations create/use CPU backend and delegate to std::vector's assign() method. Fixes compilation error in test_msgs and other generated message code. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
nvcyc
force-pushed
the
rolling-native-buffer
branch
from
February 6, 2026 19:37
c38418d to
e6dff7d
Compare
nvcyc
force-pushed
the
rolling-native-buffer
branch
from
March 13, 2026 04:55
c874df7 to
980eea0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated code tries to initialize Buffer fields using brace-enclosed initializer lists, but Buffer class was missing the necessary constructor and assignment operator.
Added:
#include <initializer_list>headerBuffer(std::initializer_list<T>)operator=(std::initializer_list<T>)Both operations create/use CPU backend and delegate to
std::vector::assign()method.Fixes: Compilation error in
test_msgsand other generated message code that uses default values for Buffer fields.Testing:
test_msgspackage now builds successfullyRelated:
rolling-native-buffer)🤖 Generated with Claude Code