Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to fix the most vexing parse problem #541

Merged
merged 3 commits into from Nov 11, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion demo_nodes_cpp/src/topics/talker.cpp
Expand Up @@ -50,7 +50,9 @@ class Talker : public rclcpp::Node
pub_->publish(std::move(msg_));
};
// Create a publisher with a custom Quality of Service profile.
rclcpp::QoS qos(rclcpp::KeepLast(7));
// Extra pair of parentheses to address vexing parse problem.
// Or use uniform initialization.
fujitatomoya marked this conversation as resolved.
Show resolved Hide resolved
rclcpp::QoS qos(rclcpp::KeepLast{7});
pub_ = this->create_publisher<std_msgs::msg::String>("chatter", qos);

// Use a timer to schedule periodic message publishing.
Expand Down