|
@@ -529,6 +529,35 @@ namespace Framework
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ bool anyMatch(std::function<bool(const TYP element)> predicate) const
|
|
|
+ {
|
|
|
+ for (TYP t : *this)
|
|
|
+ {
|
|
|
+ if (predicate(t)) return 1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool allMatch(std::function<bool(const TYP element)> predicate) const
|
|
|
+ {
|
|
|
+ for (TYP t : *this)
|
|
|
+ {
|
|
|
+ if (!predicate(t)) return 0;
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ int findIndex(std::function<bool(const TYP element)> predicate) const
|
|
|
+ {
|
|
|
+ int index = 0;
|
|
|
+ for (TYP t : *this)
|
|
|
+ {
|
|
|
+ if (predicate(t)) return index;
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
Array& operator=(const Array& arr)
|
|
|
{
|
|
|
leeren();
|
|
@@ -845,6 +874,35 @@ namespace Framework
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ bool anyMatch(std::function<bool(const TYP* zElement)> predicate) const
|
|
|
+ {
|
|
|
+ for (TYP* t : *this)
|
|
|
+ {
|
|
|
+ if (predicate(t)) return 1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool allMatch(std::function<bool(const TYP* zElement)> predicate) const
|
|
|
+ {
|
|
|
+ for (TYP* t : *this)
|
|
|
+ {
|
|
|
+ if (!predicate(t)) return 0;
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ int findIndex(std::function<bool(const TYP* zElement)> predicate) const
|
|
|
+ {
|
|
|
+ int index = 0;
|
|
|
+ for (TYP* t : *this)
|
|
|
+ {
|
|
|
+ if (predicate(t)) return index;
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
RCArray& operator=(const RCArray& arr)
|
|
|
{
|
|
|
leeren();
|