15 #ifndef RCLCPP__FUNCTION_TRAITS_HPP_ 16 #define RCLCPP__FUNCTION_TRAITS_HPP_ 41 template<
typename Head,
typename ... Tail>
48 template<
typename FunctionT>
54 static constexpr
std::size_t arity = std::tuple_size<arguments>::value;
56 template<std::
size_t N>
63 template<
typename ReturnTypeT,
typename ... Args>
68 static constexpr
std::size_t arity = std::tuple_size<arguments>::value;
70 template<std::
size_t N>
77 template<
typename ReturnTypeT,
typename ... Args>
82 template<
typename ClassT,
typename ReturnTypeT,
typename ... Args,
typename ... FArgs>
83 #if defined _LIBCPP_VERSION // libc++ (Clang) 84 struct function_traits<std::__bind<ReturnTypeT (ClassT::*)(Args ...), FArgs ...>>
85 #elif defined _GLIBCXX_RELEASE // glibc++ (GNU C++ >= 7.1) 86 struct
function_traits<std::_Bind<ReturnTypeT(ClassT::*(FArgs ...))(Args ...)>>
87 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 88 struct
function_traits<std::_Bind<std::_Mem_fn<ReturnTypeT (ClassT::*)(Args ...)>(FArgs ...)>>
89 #elif defined _MSC_VER // MS Visual Studio 91 std::_Binder<std::_Unforced, ReturnTypeT(__cdecl ClassT::*)(Args ...), FArgs ...>
94 #error "Unsupported C++ compiler / standard library" 100 template<
typename ReturnTypeT,
typename ... Args,
typename ... FArgs>
101 #if defined _LIBCPP_VERSION // libc++ (Clang) 102 struct function_traits<std::__bind<ReturnTypeT( &)(Args ...), FArgs ...>>
103 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 104 struct
function_traits<std::_Bind<ReturnTypeT(*(FArgs ...))(Args ...)>>
105 #elif defined _MSC_VER // MS Visual Studio 106 struct
function_traits<std::_Binder<std::_Unforced, ReturnTypeT(__cdecl &)(Args ...), FArgs ...>>
108 #error "Unsupported C++ compiler / standard library" 114 template<
typename ClassT,
typename ReturnTypeT,
typename ... Args>
119 template<
typename FunctionT>
123 template<
typename FunctionT>
131 template<std::
size_t Arity,
typename FunctorT>
133 bool, (Arity == function_traits<FunctorT>::arity)> {};
135 template<
typename FunctorT,
typename ... Args>
137 typename function_traits<FunctorT>::arguments,
142 template<
typename FunctorAT,
typename FunctorBT>
144 typename function_traits<FunctorAT>::arguments,
145 typename function_traits<FunctorBT>::arguments
153 #endif // RCLCPP__FUNCTION_TRAITS_HPP_ Definition: function_traits.hpp:136
typename std::tuple_element< N, arguments >::type argument_type
Definition: function_traits.hpp:71
typename tuple_tail< typename function_traits< decltype(&FunctionT::operator())>::arguments >::type arguments
Definition: function_traits.hpp:52
Definition: function_traits.hpp:49
typename function_traits< decltype(&ReturnTypeT(ClassT &, Args ...) ::operator())>::return_type return_type
Definition: function_traits.hpp:59
This header provides the get_node_topics_interface() template function.
Definition: allocator_common.hpp:24
ReturnTypeT return_type
Definition: function_traits.hpp:73
Definition: function_traits.hpp:143
Definition: function_traits.hpp:132
Definition: function_traits.hpp:39
typename std::tuple_element< N, arguments >::type argument_type
Definition: function_traits.hpp:57