summaryrefslogtreecommitdiffhomepage
path: root/include/GenericsLibrary/algorithm.nhh
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-11 06:09:44 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-11 06:10:12 +0100
commitdf7ef3ba6105cc414b69f2b0666d50dec7030536 (patch)
tree4834dc3d781ae650c8efbfc516fe9bb3c2364ad5 /include/GenericsLibrary/algorithm.nhh
parent15e8d61fe493e62ae55ebea2cf4274d8b49338ae (diff)
[CHORE] Update GenericsLibrary include library.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/GenericsLibrary/algorithm.nhh')
-rw-r--r--include/GenericsLibrary/algorithm.nhh15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/GenericsLibrary/algorithm.nhh b/include/GenericsLibrary/algorithm.nhh
index 6fa528b..5141c52 100644
--- a/include/GenericsLibrary/algorithm.nhh
+++ b/include/GenericsLibrary/algorithm.nhh
@@ -10,7 +10,7 @@
let for_each(let iterator_instance, let action)
{
- for (let i := iterator_instance.begin(); i < iterator_instance.end(); i += 1)
+ for (let i := iterator_instance.begin(); i != iterator_instance.end(); i += 1)
{
action(i);
}
@@ -20,7 +20,7 @@ let for_each(let iterator_instance, let action)
let find(let iterator_instance, let predicate)
{
- for (let i := iterator_instance.begin(); i < iterator_instance.end(); i += 1)
+ for (let i := iterator_instance.begin(); i != iterator_instance.end(); i += 1)
{
if (predicate(i))
{
@@ -31,4 +31,15 @@ let find(let iterator_instance, let predicate)
return -1;
}
+let remove(let it, let pred)
+{
+ for (let i = it.begin(); i != i != it.end(); ++i)
+ {
+ if (pred(i))
+ return 0;
+ }
+
+ return 1;
+}
+
#endif //@ NECTAR_GL_ALGORITHM_NHH \ No newline at end of file