summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-25 09:15:08 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-25 09:15:08 +0100
commite101c9a779a8df023973be161453994fe2aa6346 (patch)
treeeac723ee0404357844adaf8d2e15d3a0cc99480f /lib
parent67670dd3be23a731e3ac4156c36e873102159042 (diff)
feat(lib): Introduce varadic arguments by reference instead of copying
them. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/stdx.cc9
-rw-r--r--lib/stdx.hpp12
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/stdx.cc b/lib/stdx.cc
index bbc7ef0..dd6d4c6 100644
--- a/lib/stdx.cc
+++ b/lib/stdx.cc
@@ -1,5 +1,10 @@
-/* written by Amlal El Mahrouss */
+/*
+ * File: stdx.cc
+ * Author: Amlal El Mahrouss,
+ * Copyright 2023-2025, Amlal El Mahrouss all rights reserved.
+ */
+
#include <stdx.hpp>
-// eof
+// EOF
diff --git a/lib/stdx.hpp b/lib/stdx.hpp
index 828f319..845bb67 100644
--- a/lib/stdx.hpp
+++ b/lib/stdx.hpp
@@ -1,5 +1,5 @@
/*
- * File: stdx
+ * File: stdx.hpp
* Author: Amlal El Mahrouss,
* Copyright 2023-2025, Amlal El Mahrouss all rights reserved.
*/
@@ -38,8 +38,8 @@ namespace stdx
};
- template <typename Teller, typename... Args>
- stdx::ret eval(Teller tell, Args... arg)
+ template <typename Teller, typename... Lst>
+ stdx::ret eval(Teller tell, Lst&&... arg)
{
return tell(arg...) ? stdx::ret::okay : stdx::ret::err;
}
@@ -78,21 +78,21 @@ namespace stdx
}
template <typename... Lst>
- ret eval_less_than(Lst... arg)
+ ret eval_less_than(Lst&&... arg)
{
static traits::int_less_than_teller eq;
return eq(arg...) ? ret::okay : ret::err;
}
template <typename... Lst>
- ret eval_eq(Lst... arg)
+ ret eval_eq(Lst&&... arg)
{
static traits::int_eq_teller less_than;
return less_than(arg...) ? ret::okay : ret::err;
}
template <typename... Lst>
- ret eval_greater(Lst... arg)
+ ret eval_greater(Lst&&... arg)
{
static traits::int_greater_than_teller greater_than;
return greater_than(arg...) ? ret::okay : ret::err;