From 005131dba8d7992d9f93b889d0eb265db663b8c5 Mon Sep 17 00:00:00 2001 From: Emerson Knapp <537409+emersonknapp@users.noreply.github.com> Date: Fri, 17 May 2019 18:18:58 -0700 Subject: [PATCH] I realize why the original was spelled wrong, volatile is a c++ keyword. Modify to not require learning a misspelling, and note why it can't have that name (#725) Signed-off-by: Emerson Knapp --- rclcpp/include/rclcpp/qos.hpp | 5 ++++- rclcpp/src/rclcpp/qos.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rclcpp/include/rclcpp/qos.hpp b/rclcpp/include/rclcpp/qos.hpp index 512a638..6f7db78 100644 --- a/rclcpp/include/rclcpp/qos.hpp +++ b/rclcpp/include/rclcpp/qos.hpp @@ -105,8 +105,11 @@ public: durability(rmw_qos_durability_policy_t durability); /// Set the durability setting to volatile. + /** + * Note that this cannot be named `volatile` because it is a C++ keyword. + */ QoS & - volatile(); + durability_volatile(); /// Set the durability setting to transient local. QoS & diff --git a/rclcpp/src/rclcpp/qos.cpp b/rclcpp/src/rclcpp/qos.cpp index a909f30..bec92fd 100644 --- a/rclcpp/src/rclcpp/qos.cpp +++ b/rclcpp/src/rclcpp/qos.cpp @@ -120,7 +120,7 @@ QoS::durability(rmw_qos_durability_policy_t durability) } QoS & -QoS::volatile() +QoS::durability_volatile() { return this->durability(RMW_QOS_POLICY_DURABILITY_VOLATILE); }