2018-10-16 14:13:19 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace util {
|
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
template <typename Container, typename UnaryPredicate>
|
|
|
|
typename Container::iterator find_if(Container &container,
|
|
|
|
UnaryPredicate pred)
|
|
|
|
{
|
|
|
|
return std::find_if(container.begin(), container.end(), pred);
|
|
|
|
}
|
2018-10-16 14:13:19 +02:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
template <typename Container, typename UnaryPredicate>
|
|
|
|
bool any_of(Container &container, UnaryPredicate pred)
|
|
|
|
{
|
|
|
|
return std::any_of(container.begin(), container.end(), pred);
|
|
|
|
}
|
2018-10-16 14:13:19 +02:00
|
|
|
|
|
|
|
} // namespace util
|
|
|
|
} // namespace chatterino
|