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 ClassT,
typename ReturnTypeT,
typename ... Args,
typename ... FArgs>
101 #if defined _LIBCPP_VERSION // libc++ (Clang) 102 struct function_traits<std::__bind<ReturnTypeT (ClassT::*)(Args ...) const, FArgs ...>>
103 #elif defined _GLIBCXX_RELEASE // glibc++ (GNU C++ >= 7.1) 104 struct
function_traits<std::_Bind<ReturnTypeT(ClassT::*(FArgs ...))(Args ...) const>>
105 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 106 struct
function_traits<std::_Bind<std::_Mem_fn<ReturnTypeT (ClassT::*)(Args ...) const>(FArgs ...)>>
107 #elif defined _MSC_VER // MS Visual Studio 109 std::_Binder<std::_Unforced, ReturnTypeT(__cdecl ClassT::*)(Args ...) const, FArgs ...>
112 #error "Unsupported C++ compiler / standard library" 118 template<
typename ReturnTypeT,
typename ... Args,
typename ... FArgs>
119 #if defined _LIBCPP_VERSION // libc++ (Clang) 120 struct function_traits<std::__bind<ReturnTypeT( &)(Args ...), FArgs ...>>
121 #elif defined __GLIBCXX__ // glibc++ (GNU C++) 122 struct
function_traits<std::_Bind<ReturnTypeT(*(FArgs ...))(Args ...)>>
123 #elif defined _MSC_VER // MS Visual Studio 124 struct
function_traits<std::_Binder<std::_Unforced, ReturnTypeT(__cdecl &)(Args ...), FArgs ...>>
126 #error "Unsupported C++ compiler / standard library" 132 template<
typename ClassT,
typename ReturnTypeT,
typename ... Args>
137 template<
typename FunctionT>
141 template<
typename FunctionT>
149 template<std::
size_t Arity,
typename FunctorT>
151 bool, (Arity == function_traits<FunctorT>::arity)> {};
153 template<
typename FunctorT,
typename ... Args>
155 typename function_traits<FunctorT>::arguments,
160 template<
typename FunctorAT,
typename FunctorBT>
162 typename function_traits<FunctorAT>::arguments,
163 typename function_traits<FunctorBT>::arguments
171 #endif // RCLCPP__FUNCTION_TRAITS_HPP_ Definition: function_traits.hpp:154
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_base_interface() template function.
Definition: allocator_common.hpp:24
ReturnTypeT return_type
Definition: function_traits.hpp:73
Definition: function_traits.hpp:161
Definition: function_traits.hpp:150
Definition: function_traits.hpp:39
typename std::tuple_element< N, arguments >::type argument_type
Definition: function_traits.hpp:57