mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 03:57:35 +00:00
AK: Rewrite {AnyOf,AllOf,Find}.h to use the IteratorPairWith concept
This makes it so these algorithms are usable with arbitrary iterators, as opposed to just instances of AK::SimpleIterator. This commit also makes the requirement of ::index() in find_index() explicit, as previously it was accepting any iterator.
This commit is contained in:
parent
2dc31c503e
commit
73fc2b3748
3 changed files with 15 additions and 14 deletions
|
@ -11,10 +11,10 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
template<typename Container, typename ValueType>
|
||||
template<typename TEndIterator, IteratorPairWith<TEndIterator> TIterator>
|
||||
constexpr bool all_of(
|
||||
SimpleIterator<Container, ValueType> const& begin,
|
||||
SimpleIterator<Container, ValueType> const& end,
|
||||
TIterator const& begin,
|
||||
TEndIterator const& end,
|
||||
auto const& predicate)
|
||||
{
|
||||
for (auto iter = begin; iter != end; ++iter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue