diff -r 6ca6e8c647d4 -r 128efb9d148b src/functional.h --- a/src/functional.h Mon Jul 19 23:41:52 2021 +0300 +++ b/src/functional.h Tue Jul 20 01:22:01 2021 +0300 @@ -157,3 +157,29 @@ return result; } } + +template +bool any(T&& container, Fn&& f) +{ + for (auto&& x : container) + { + if (f(x)) + { + return true; + } + } + return false; +} + +template +bool all(T&& container, Fn&& f) +{ + for (auto&& x : container) + { + if (not f(x)) + { + return false; + } + } + return true; +}