From 2448ac2ef13d96e4ef3b7a9a15ef1cfdc2195831 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 14 Dec 2025 02:18:46 +0100 Subject: chore: `option.hpp` improvements, new examples in `examples`. Signed-off-by: Amlal El Mahrouss --- include/ocl/option.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/ocl/option.hpp b/include/ocl/option.hpp index c1bc5cc..d84e935 100644 --- a/include/ocl/option.hpp +++ b/include/ocl/option.hpp @@ -69,7 +69,8 @@ namespace ocl { struct int_eq_teller final { - bool operator()(int a, int b) + template + bool operator()(ObjFirst a, ObjLast b) { return (a == b); } @@ -77,7 +78,8 @@ namespace ocl struct int_greater_than_teller final { - bool operator()(int a, int b) + template + bool operator()(ObjFirst a, ObjLast b) { return (a > b); } @@ -85,7 +87,8 @@ namespace ocl struct int_less_than_teller final { - bool operator()(int a, int b) + template + bool operator()(ObjFirst a, ObjLast b) { return (a < b); } @@ -95,22 +98,19 @@ namespace ocl template inline return_type eval_less_than(Lst&&... arg) { - static detail::int_less_than_teller eq; - return eq(std::forward(arg)...) ? return_type::okay : return_type::err; + return detail::int_less_than_teller{}(std::forward(arg)...) ? return_type::okay : return_type::err; } template inline return_type eval_eq(Lst&&... arg) { - static detail::int_eq_teller less_than; - return less_than(std::forward(arg)...) ? return_type::okay : return_type::err; + return detail::int_eq_teller{}(std::forward(arg)...) ? return_type::okay : return_type::err; } template inline return_type eval_greater_than(Lst&&... arg) { - static detail::int_greater_than_teller greater_than; - return greater_than(std::forward(arg)...) ? return_type::okay : return_type::err; + return detail::int_greater_than_teller{}(std::forward(arg)...) ? return_type::okay : return_type::err; } inline return_type eval_true() noexcept -- cgit v1.2.3