Commit 9b52d193 authored by Eike Ziller's avatar Eike Ziller

Add Utils::filtered as a wrapper around std::copy_if

Change-Id: I4a189581a4a7f42f880c47b91372d7e96d50655e
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent a4476454
......@@ -337,6 +337,18 @@ auto transform(const SC &container, R (S::*p)() const)
>::call(container, p);
}
//////////////////
// filtered
/////////////////
template<typename C, typename F>
C filtered(const C &container, F predicate)
{
C out;
std::copy_if(container.begin(), container.end(),
inserter(out), predicate);
return out;
}
//////////////////
// sort
/////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment