15 #ifndef RCLCPP__FUNCTION_TRAITS_HPP_ 16 #define RCLCPP__FUNCTION_TRAITS_HPP_ 41 template<
typename Head,
typename ... Tail>
44 using type = std::tuple<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::__1::__bind<ReturnTypeT (ClassT::*)(Args ...), FArgs ...>>
85 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 86 struct
function_traits<std::_Bind<std::_Mem_fn<ReturnTypeT (ClassT::*)(Args ...)>(FArgs ...)>>
87 #elif defined _MSC_VER // MS Visual Studio 89 std::_Binder<std::_Unforced, ReturnTypeT(__cdecl ClassT::*)(Args ...), FArgs ...>
92 #error "Unsupported C++ compiler / standard library" 98 template<
typename ReturnTypeT,
typename ... Args,
typename ... FArgs>
99 #if defined _LIBCPP_VERSION // libc++ (Clang) 100 struct function_traits<std::__1::__bind<ReturnTypeT( &)(Args ...), FArgs ...>>
101 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 102 struct
function_traits<std::_Bind<ReturnTypeT(*(FArgs ...))(Args ...)>>
103 #elif defined _MSC_VER // MS Visual Studio 104 struct
function_traits<std::_Binder<std::_Unforced, ReturnTypeT(__cdecl &)(Args ...), FArgs ...>>
106 #error "Unsupported C++ compiler / standard library" 112 template<
typename ClassT,
typename ReturnTypeT,
typename ... Args>
117 template<
typename FunctionT>
121 template<
typename FunctionT>
129 template<std::
size_t Arity,
typename FunctorT>
131 bool, (Arity == function_traits<FunctorT>::arity)>{};
133 template<
typename FunctorT,
typename ... Args>
135 typename function_traits<FunctorT>::arguments,
140 template<
typename FunctorAT,
typename FunctorBT>
142 typename function_traits<FunctorAT>::arguments,
143 typename function_traits<FunctorBT>::arguments
151 #endif // RCLCPP__FUNCTION_TRAITS_HPP_ Definition: function_traits.hpp:134
typename std::tuple_element< N, arguments >::type argument_type
Definition: function_traits.hpp:71
Definition: function_traits.hpp:49
Definition: allocator_common.hpp:24
Definition: parameter.hpp:235
ReturnTypeT return_type
Definition: function_traits.hpp:73
std::tuple< Tail ... > type
Definition: function_traits.hpp:44
Definition: function_traits.hpp:141
typename function_traits< decltype(&ReturnTypeT(ClassT &, Args ...) ::operator())>::return_type return_type
Definition: function_traits.hpp:59
Definition: function_traits.hpp:130
typename tuple_tail< typename function_traits< decltype(&FunctionT::operator())>::arguments >::type arguments
Definition: function_traits.hpp:52
Definition: function_traits.hpp:39
typename std::tuple_element< N, arguments >::type argument_type
Definition: function_traits.hpp:57
std::tuple< Args ... > arguments
Definition: function_traits.hpp:66