From bdf2ac80c17b27a3cec6475b57ab34d78a798203 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Wed, 14 Oct 2015 13:29:31 -0700 Subject: [PATCH] small changes to make the publish const reference api work --- rclcpp/include/rclcpp/publisher.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rclcpp/include/rclcpp/publisher.hpp b/rclcpp/include/rclcpp/publisher.hpp index b1e2fc7..d75ed05 100644 --- a/rclcpp/include/rclcpp/publisher.hpp +++ b/rclcpp/include/rclcpp/publisher.hpp @@ -295,14 +295,13 @@ public: return this->publish(unique_msg); } - void publish(const MessageT & msg) { // Avoid allocating when not using intra process. if (!store_intra_process_message_) { // In this case we're not using intra process. - return this->do_inter_process_publish(msg.get()); + return this->do_inter_process_publish(&msg); } // Otherwise we have to allocate memory in a unique_ptr and pass it along. std::unique_ptr unique_msg(new MessageT(msg));