Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=bbb2d288ec1220827d6fe5ee93310de85c6111a1

commit bbb2d288ec1220827d6fe5ee93310de85c6111a1
Author: Michel Hermier <herm...@frugalware.org>
Date:   Mon Oct 27 17:25:45 2014 +0100

libpacman: Add Flist (all|any)_match(_if) helpers.

diff --git a/lib/libpacman/util/flist.h b/lib/libpacman/util/flist.h
index b028dbe..0bae4d6 100644
--- a/lib/libpacman/util/flist.h
+++ b/lib/libpacman/util/flist.h
@@ -879,6 +879,30 @@ public:
FCListItem::swap(o);
}

+       template <class U>
+       bool all_match(const U &val) const
+       {
+               return flib::all_match(begin(), end(), val);
+       }
+
+       template <class UnaryPredicate>
+       bool all_match_if(UnaryPredicate pred) const
+       {
+               return flib::all_match_if(begin(), end(), pred);
+       }
+
+       template <class U>
+       bool any_match(const U &val) const
+       {
+               return flib::any_match(begin(), end(), val());
+       }
+
+       template <class UnaryPredicate>
+       bool any_match_if(UnaryPredicate pred)
+       {
+               return flib::any_match_if(begin(), end(), pred);
+       }
+
public:
iterable c_first() const
{
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to