The second example (the one with `auto msg` in the lambda) is ambiguous, I think. What should the type of `msg` be? `std_msgs::msg::String::ConstSharePtr` or `std_msgs::msg::String::UniquePtr` or something else? I don't think the compiler can implicitly infer which type you mean in this situation.
What you're doing might work if you also supplied the `CallbackT` template argument to `create_subscription`.
I'll play around with the example and see if I can simplify it. It should be possible, in principle, to do implicit template specialization on the `create_subscription` method, such that you can drop the `<std_msgs::msg::String>` explicit template specialization. Then you'd just need to explicitly type the `msg` parameter to the lambda.
---
[Visit Topic](
https://discourse.ros.org/t/rfc-using-c-14/921/10) or reply to this email to respond.
If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
ros-users@lists.ros.org
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <
http://lists.ros.org/mailman//options/ros-users>