Added support to function_traits for std::bind in GCC >= 7.1#346
Added support to function_traits for std::bind in GCC >= 7.1#346mikaelarguedas merged 2 commits intoros2:masterfrom
Conversation
|
A bit of an explanation of what happens here. Let's take @jpgr87 's compiler output from #343 : ... /home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp: In instantiation of ‘struct rclcpp::function_traits::function_traits<std::_Bind< int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>, std::_Placeholder<2>))(bool, float)> >’: ... this error happens because the
so having all that, we can construct a signature for struct function_traits<std::_Bind< int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>, std::_Placeholder<2>)) (bool, float)> becomes: struct function_traits<std::_Bind< ReturnTypeT (ClassT::*(ClassT*, FArgs ...)) (Args ...)>> I hope that helped. @clalancette @allenh1 I often called |
|
@esteve thank you for the fix, and thank you for the super detailed explanation! I appreciate it, and definitely learned a thing or two. Cheers! |
|
@allenh1 no problem :-) Glad to hear it helped, it's unfortunate that the |
|
@esteve this definitely compiles with GCC 8.0 as well. Does this still work with 5.4? |
|
@esteve Looks like the linter is unhappy. --- include/rclcpp/function_traits.hpp
+++ include/rclcpp/function_traits.hpp.uncrustify
@@ -86 +86 @@
-struct function_traits<std::_Bind<ReturnTypeT (ClassT::*(ClassT*, FArgs ...))(Args ...)>>
+struct function_traits<std::_Bind<ReturnTypeT(ClassT::*(ClassT *, FArgs ...))(Args ...)>>Other than that, it appears GCC 5.4 is ok with these changes (that's quite relieving!). |
|
given that Shout out to @esteve for the quick fix and the great explanation! |
|
CI is green, I;m going to squash and merge this if there is no objection |
|
@allenh1 @mikaelarguedas thanks for fixing the linter errors, I forgot to run |
|
It happens. Thanks for the fix! |
* Allow rosbag2_transport::Recorder to take per-topic QoS profile overrides for recording Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
GCC changed the internal implementation of
std::bind, this PR updatesfunction_traitsto match their current signature.Connects to #343