9 #include "opentelemetry/nostd/detail/decay.h"
10 #include "opentelemetry/nostd/detail/void.h"
11 #include "opentelemetry/version.h"
13 #define OPENTELEMETRY_RETURN(...) \
14 noexcept(noexcept(__VA_ARGS__))->decltype(__VA_ARGS__) \
39 template <
typename R,
typename T,
typename Arg,
typename... Args>
40 inline static constexpr
auto invoke(R T::*pmf, Arg &&arg, Args &&...args)
47 template <
typename R,
typename T,
typename Arg,
typename... Args>
48 inline static constexpr
auto invoke(R T::*pmf, Arg &&arg, Args &&...args)
55 template <
typename R,
typename T,
typename Arg,
typename... Args>
56 inline static constexpr
auto invoke(R T::*pmf, Arg &&arg, Args &&...args)
63 template <
typename R,
typename T,
typename Arg>
64 inline static constexpr
auto invoke(R T::*pmo, Arg &&arg)
71 template <
typename R,
typename T,
typename Arg>
72 inline static constexpr
auto invoke(R T::*pmo, Arg &&arg)
79 template <
typename R,
typename T,
typename Arg>
80 inline static constexpr
auto invoke(R T::*pmo, Arg &&arg)
84 template <
typename R,
typename T,
typename Arg,
typename... Args>
86 Invoke<std::is_function<R>::value,
87 (std::is_base_of<T, decay_t<Arg>>::value ? 0
88 : is_reference_wrapper<decay_t<Arg>>::value ? 1
90 std::forward<Arg>(arg),
91 std::forward<Args>(args)...))
94 # pragma warning(push)
95 # pragma warning(disable : 4100)
97 template <
typename F,
typename... Args>
98 inline constexpr
auto invoke_impl(F &&f, Args &&...args)
101 # pragma warning(pop)
106 template <
typename F,
typename... Args>
107 inline constexpr
auto invoke(F &&f, Args &&... args)
114 template <
typename Void,
typename,
typename...>
118 template <
typename F,
typename... Args>
122 using type = decltype(
nostd::invoke(std::declval<F>(), std::declval<Args>()...));
127 template <
typename F,
typename... Args>
130 template <
typename F,
typename... Args>
136 template <
typename Void,
typename,
typename...>
140 template <
typename F,
typename... Args>
144 template <
typename Void,
typename,
typename,
typename...>
148 template <
typename R,
typename F,
typename... Args>
150 : std::is_convertible<invoke_result_t<F, Args...>, R>
155 template <
typename F,
typename... Args>
158 template <
typename R,
typename F,
typename... Args>
163 #undef OPENTELEMETRY_RETURN