12 #include <type_traits>
14 #define INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN(...) \
15 noexcept(noexcept(__VA_ARGS__)) -> decltype (__VA_ARGS__) { return __VA_ARGS__; }
29 template <
typename... Args >
35 template <
typename... Args >
45 template <
typename T,
T... Ints >
48 static constexpr std::size_t
size() noexcept {
return sizeof...(Ints); }
51 template < std::size_t... Ints >
56 template <
typename T, std::size_t
N,
T... Ints >
60 template <
typename T,
T... Ints >
65 template <
typename T, std::
size_t N >
68 template < std::
size_t N >
71 template <
typename... Ts >
83 template <
typename T >
87 template <
typename U >
92 template <
typename T >
111 typename Base,
typename F,
typename Derived,
114 constexpr
auto invoke_member_object_impl(F Base::*
f, Derived&&
ref)
116 std::forward<Derived>(
ref).*f)
120 typename Base, typename F, typename RefWrap,
121 typename std::enable_if<is_reference_wrapper<typename std::decay<RefWrap>::
type>::
value,
int>::
type = 0
123 constexpr auto invoke_member_object_impl(F Base::* f, RefWrap&&
ref)
129 typename Base, typename F, typename Pointer,
130 typename std::enable_if<
131 !std::is_base_of<Base, typename std::decay<Pointer>::
type>::value &&
132 !is_reference_wrapper<typename std::decay<Pointer>::
type>::value
135 constexpr auto invoke_member_object_impl(F Base::* f, Pointer&&
ptr)
137 (*std::forward<Pointer>(
ptr)).*f)
145 typename Base, typename F, typename Derived, typename... Args,
146 typename std::enable_if<std::is_base_of<Base, typename std::decay<Derived>::
type>::value,
int>::
type = 0
148 constexpr auto invoke_member_function_impl(F Base::* f, Derived&&
ref, Args&&...
args)
150 (std::forward<Derived>(ref).*f)(std::forward<Args>(
args)...))
154 typename Base, typename F, typename RefWrap, typename... Args,
155 typename std::enable_if<is_reference_wrapper<typename std::decay<RefWrap>::
type>::value,
int>::
type = 0
157 constexpr auto invoke_member_function_impl(F Base::* f, RefWrap&& ref, Args&&...
args)
159 (ref.
get().*f)(std::forward<Args>(
args)...))
163 typename Base, typename F, typename Pointer, typename... Args,
164 typename std::enable_if<
165 !std::is_base_of<Base, typename std::decay<Pointer>::
type>::value &&
166 !is_reference_wrapper<typename std::decay<Pointer>::
type>::value
169 constexpr auto invoke_member_function_impl(F Base::* f, Pointer&&
ptr, Args&&...
args)
171 ((*std::forward<Pointer>(ptr)).*f)(std::forward<Args>(
args)...))
176 typename F, typename... Args,
177 typename std::enable_if<!std::is_member_pointer<typename std::decay<F>::
type>::value,
int>::
type = 0
181 std::forward<F>(f)(std::forward<Args>(
args)...))
185 typename F, typename T,
186 typename std::enable_if<std::is_member_object_pointer<typename std::decay<F>::
type>::value,
int>::
type = 0
188 constexpr auto
invoke(F&& f, T&&
t)
190 impl::invoke_member_object_impl(std::forward<F>(f), std::forward<T>(
t)))
194 typename F, typename... Args,
195 typename std::enable_if<std::is_member_function_pointer<typename std::decay<F>::
type>::value,
int>::
type = 0
199 impl::invoke_member_function_impl(std::forward<F>(f), std::forward<Args>(
args)...))
212 template <
typename Void,
typename F,
typename... Args >
215 template <
typename F,
typename... Args >
221 template <
typename F,
typename... Args >
225 template <
typename F,
typename... Args >
239 template <
typename Void,
typename R,
typename F,
typename... Args >
241 : std::false_type {};
243 template <
typename R,
typename F,
typename... Args >
246 std::is_void<R>::value,
248 std::is_convertible<invoke_result_t<F, Args...>, R>>
::type {};
251 template <
typename R,
typename F,
typename... Args >
255 template <
typename F,
typename... Args >
267 template <
typename F,
typename Tuple, std::size_t... I >
268 constexpr
auto apply_impl(F&& f, Tuple&&
args, index_sequence<I...>)
272 std::get<I>(std::forward<Tuple>(
args))...))
275 template <
typename F,
typename Tuple >
276 constexpr
auto apply(F&& f, Tuple&&
args)
280 std::forward<Tuple>(
args),
284 #undef INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN
static constexpr std::size_t size() noexcept
GLsizei const GLfloat * value
make_integer_sequence< std::size_t, N > make_index_sequence
decltype(invoke_hpp::invoke(std::declval< F >(), std::declval< Args >()...)) type
#define INVOKE_HPP_NOEXCEPT_DECLTYPE_RETURN(...)
auto get(const UT_ARTIterator< T > &it) -> decltype(it.key())
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
typename invoke_result< F, Args...>::type invoke_result_t
#define PXR_NAMESPACE_CLOSE_SCOPE
GA_API const UT_StringHolder N
**If you just want to fire and args
typename impl::make_void< Args...>::type void_t
int invoke(const Func &taskFunc1, Rest...taskFuncN)