forked from qt-creator/qt-creator
Algorithm: Add a member variant for transform
Change-Id: I329ee764cc13dd8b794c6769a2baf2f41d6a9983 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
bc562bbea9
commit
4136e36c6f
@@ -282,6 +282,15 @@ decltype(auto) transform(const C &container, R (S::*p)() const)
|
||||
>::call(container, p);
|
||||
}
|
||||
|
||||
template<typename C,
|
||||
typename R,
|
||||
typename S>
|
||||
Q_REQUIRED_RESULT
|
||||
decltype(auto) transform(const C &container, R S::*member)
|
||||
{
|
||||
return transform(container, std::mem_fn(member));
|
||||
}
|
||||
|
||||
// different container types for input and output, e.g. transforming a QList into a QSet
|
||||
template<template<typename> class C, // result container type
|
||||
typename SC, // input container type
|
||||
|
||||
Reference in New Issue
Block a user