7#include <QtCore/qtconfigmacros.h>
10#pragma qt_class(QOverload)
18auto qOverload(T functionPointer);
20auto qConstOverload(T memberFunctionPointer);
22auto qNonConstOverload(T memberFunctionPointer);
24template <
typename... Args>
25struct QNonConstOverload
27 template <
typename R,
typename T>
28 constexpr auto operator()(R (T::*ptr)(Args...))
const noexcept ->
decltype(ptr)
31 template <
typename R,
typename T>
32 static constexpr auto of(R (T::*ptr)(Args...))
noexcept ->
decltype(ptr)
36template <
typename... Args>
39 template <
typename R,
typename T>
40 constexpr auto operator()(R (T::*ptr)(Args...)
const)
const noexcept ->
decltype(ptr)
43 template <
typename R,
typename T>
44 static constexpr auto of(R (T::*ptr)(Args...)
const)
noexcept ->
decltype(ptr)
48template <
typename... Args>
57 constexpr auto operator()(R (*ptr)(Args...))
const noexcept ->
decltype(ptr)
61 static constexpr auto of(R (*ptr)(Args...))
noexcept ->
decltype(ptr)
71#define QT_VA_ARGS_CHOOSE(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N
72#define QT_VA_ARGS_EXPAND(...) __VA_ARGS__
73#define QT_VA_ARGS_COUNT(...) QT_VA_ARGS_EXPAND(QT_VA_ARGS_CHOOSE(__VA_ARGS__, 9
, 8
, 7
, 6
, 5
, 4
, 3
, 2
, 1
, 0
))
74#define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) MACRO##_##ARGC
constexpr QOverload< Args... > qOverload
#define QT_OVERLOADED_MACRO_IMP(MACRO, ARGC)
constexpr QConstOverload< Args... > qConstOverload
#define QT_VA_ARGS_CHOOSE(_1, _2, _3, _4, _5, _6, _7, _8, _9, N,...)
#define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC)
constexpr QNonConstOverload< Args... > qNonConstOverload
#define QT_VA_ARGS_EXPAND(...)
#define QT_VA_ARGS_COUNT(...)
constexpr auto operator()(R(T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
static constexpr auto of(R(T::*ptr)(Args...) const) noexcept -> decltype(ptr)
static constexpr auto of(R(*ptr)(Args...)) noexcept -> decltype(ptr)
constexpr auto operator()(R(*ptr)(Args...)) const noexcept -> decltype(ptr)