forked from qt-creator/qt-creator
'transform' algorithm compatibility to C++20
Change-Id: I3d2e756bb5bbc034b36fd74b2569f089949b898b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -905,7 +905,7 @@ template<template<typename...> class C, // container type
|
|||||||
typename F, // function type
|
typename F, // function type
|
||||||
typename... CArgs> // Arguments to SC
|
typename... CArgs> // Arguments to SC
|
||||||
Q_REQUIRED_RESULT
|
Q_REQUIRED_RESULT
|
||||||
decltype(auto) transform(C<CArgs...> &container, F function)
|
auto transform(C<CArgs...> &container, F function) -> decltype(auto)
|
||||||
{
|
{
|
||||||
return transform<C, C<CArgs...> &>(container, function);
|
return transform<C, C<CArgs...> &>(container, function);
|
||||||
}
|
}
|
||||||
@@ -937,7 +937,7 @@ decltype(auto) transform(C<CArgs...> &container, R S::*p)
|
|||||||
template<template<typename...> class C = QList, // result container
|
template<template<typename...> class C = QList, // result container
|
||||||
typename F> // Arguments to C
|
typename F> // Arguments to C
|
||||||
Q_REQUIRED_RESULT
|
Q_REQUIRED_RESULT
|
||||||
decltype(auto) transform(const QStringList &container, F function)
|
auto transform(const QStringList &container, F function)
|
||||||
{
|
{
|
||||||
return transform<C, const QList<QString> &>(static_cast<QList<QString>>(container), function);
|
return transform<C, const QList<QString> &>(static_cast<QList<QString>>(container), function);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user