From aeb68ba294fb6597aeb6c96b7fd7550fca0f277b Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Mon, 18 May 2015 10:29:17 -0700 Subject: [PATCH] ensure type of third argument of service method --- rclcpp/include/rclcpp/node.hpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/rclcpp/include/rclcpp/node.hpp b/rclcpp/include/rclcpp/node.hpp index 746ad5c7b2..c1a89434e1 100644 --- a/rclcpp/include/rclcpp/node.hpp +++ b/rclcpp/include/rclcpp/node.hpp @@ -163,15 +163,21 @@ class Node typename ServiceT, typename FunctorT, typename std::enable_if< - function_traits::arity == 2 && + function_traits::arity == 2 + >::type * = nullptr, + typename std::enable_if< std::is_same< typename function_traits::template argument_type<0>, typename std::shared_ptr - >::value && + >::value + >::type * = nullptr, + typename std::enable_if< std::is_same< typename function_traits::template argument_type<1>, typename std::shared_ptr - >::value>::type * = nullptr> + >::value + >::type * = nullptr + > typename rclcpp::service::Service::SharedPtr create_service_internal( rmw_service_t * service_handle, @@ -188,15 +194,27 @@ class Node typename ServiceT, typename FunctorT, typename std::enable_if< - function_traits::arity == 3 && + function_traits::arity == 3 + >::type * = nullptr, + typename std::enable_if< std::is_same< typename function_traits::template argument_type<0>, std::shared_ptr - >::value && + >::value + >::type * = nullptr, + typename std::enable_if< std::is_same< typename function_traits::template argument_type<1>, typename std::shared_ptr - >::value>::type * = nullptr> + >::value + >::type * = nullptr, + typename std::enable_if< + std::is_same< + typename function_traits::template argument_type<2>, + typename std::shared_ptr + >::value + >::type * = nullptr + > typename rclcpp::service::Service::SharedPtr create_service_internal( rmw_service_t * service_handle,