diff --git a/AK/Concepts.h b/AK/Concepts.h index 51f1644f986..e6a7be77c44 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -122,6 +122,13 @@ concept IterableContainer = requires { } -> IteratorPairWith().end())>; }; +template +concept IterableContainerOf = IterableContainer && requires { + { + *declval().begin() + } -> SameAs; +}; + template concept FallibleFunction = requires(Func&& func, Args&&... args) { func(forward(args)...).is_error(); @@ -173,6 +180,7 @@ using AK::Concepts::Fundamental; using AK::Concepts::Indexable; using AK::Concepts::Integral; using AK::Concepts::IterableContainer; +using AK::Concepts::IterableContainerOf; using AK::Concepts::IteratorFunction; using AK::Concepts::IteratorPairWith; using AK::Concepts::OneOf;