diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | examples/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | lib/stdx.cc | 9 | ||||
| -rw-r--r-- | lib/stdx.hpp | 12 |
4 files changed, 28 insertions, 8 deletions
@@ -30,3 +30,6 @@ *.exe *.out *.app + +# CMake build output +*/build/
\ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..0ba445b --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,12 @@ + +cmake_minimum_required(VERSION 3.15...3.31) + +project( + StrCheckusm + VERSION 1.0 + LANGUAGES CXX) + +add_executable(StrCheckusm str_checksum.cc) + +set_property(TARGET StrCheckusm PROPERTY CXX_STANDARD 20) +target_include_directories(StrCheckusm PUBLIC ../lib) 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; |
