ladybird/AK/AnyOf.h

26 lines
462 B
C
Raw Normal View History

/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Find.h>
#include <AK/Iterator.h>
namespace AK {
template<typename Container, typename ValueType>
constexpr bool any_of(
const SimpleIterator<Container, ValueType>& begin,
const SimpleIterator<Container, ValueType>& end,
const auto& predicate)
{
return find_if(begin, end, predicate) != end;
}
}
2021-02-07 10:35:08 +00:00
using AK::any_of;