40 #ifndef QTCONCURRENT_FUNCTIONWRAPPERS_H
41 #define QTCONCURRENT_FUNCTIONWRAPPERS_H
43 #include <QtConcurrent/qtconcurrentcompilertest.h>
44 #include <QtConcurrent/qtconcurrentreducekernel.h>
45 #include <QtCore/qfuture.h>
49 #if !defined(QT_NO_CONCURRENT) || defined(Q_CLANG_QDOC)
57 template <
class C,
class U>
60 return c.push_back(
u);
63 template <
class C,
class U>
66 return c.push_back(
u);
72 template <
class T,
class Enable =
void>
78 template <
class Sequence>
81 using Type = std::decay_t<decltype(*std::declval<Sequence>().begin())>;
84 template <
class Iterator>
87 using Type = std::decay_t<decltype(*std::declval<Iterator>())>;
93 template <
class T,
class MapFunctor>
96 static_assert(std::is_invocable_v<std::decay_t<MapFunctor>,
ArgumentType<T>>,
97 "It's not possible to invoke the function with passed argument.");
101 template <
class T,
class MapFunctor>
109 template <
class U,
class V>
115 template <
class T,
class C,
class U>
121 template <
class U,
class V>
127 template <
typename R,
typename ...A>
133 template <
class U,
class V>
139 template <
class T,
class C,
class U>
145 template<
class T,
class Enable =
void>
149 inline constexpr
bool hasCallOperator_v<
T, std::void_t<decltype(&T::operator())>> =
true;
151 template<
class T,
class Enable =
void>
158 template <
class Callable,
class Sequence>
161 template <
class InitialValueType,
class ResultType>
163 std::is_convertible<InitialValueType, ResultType>,
166 template<
class Callable,
class Enable =
void>
171 template <
class Callable>
173 typename
std::enable_if_t<std::is_function_v<std::remove_pointer_t<std::decay_t<Callable>>>
174 || std::is_member_function_pointer_v<std::decay_t<Callable>>>>
179 template <
class Callable>
181 typename
std::enable_if_t<!std::is_function_v<std::remove_pointer_t<std::decay_t<Callable>>>
182 && hasCallOperator_v<std::decay_t<Callable>>>>
184 using type = std::decay_t<typename QtPrivate::ArgResolver<Callable>::First>;
189 template <
class InputSequence,
class MapFunctor>
194 "Couldn't deduce the output sequence type, you must specify it explicitly.");
198 #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
200 template <
template <
typename...>
class InputSequence,
typename MapFunctor,
typename ...T>
small capitals from c petite p scientific f u
typename C::value_type value_type
std::is_invocable< Callable, typename std::decay_t< Sequence >::value_type > isInvocable
constexpr bool hasCallOperator_v
constexpr bool isInitialValueCompatible_v
typename MapResult< T, MapFunctor >::Type MapResultType
constexpr bool isIterator_v
typename Argument< T >::Type ArgumentType
def InputSequence(toptions)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
std::invoke_result_t< std::decay_t< MapFunctor >, ArgumentType< T > > Type
void operator()(C &c, U &&u) const
void operator()(C &c, const U &u) const
typename std::tuple_element< 0, std::tuple< A... > >::type ResultType
std::decay_t< typename QtPrivate::ArgResolver< Callable >::First > type
typename QtPrivate::ReduceResultType< std::decay_t< Callable > >::ResultType type