summaryrefslogtreecommitdiffhomepage
path: root/include/ocl/is_same.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-07 15:30:08 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-07 15:30:08 -0500
commita2987feb8cb486c2ff124669190c1abd4e80a8f9 (patch)
tree5970f9fae53f9f95ae897ea787f3b6ed52fc1a4a /include/ocl/is_same.hpp
parentacab3c4d9e5181dbd16790b9e2eb787d30bd946f (diff)
chore: public API improvements of the core module. new headers in WiP.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl/is_same.hpp')
-rw-r--r--include/ocl/is_same.hpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/ocl/is_same.hpp b/include/ocl/is_same.hpp
index de3425e..ec3eb66 100644
--- a/include/ocl/is_same.hpp
+++ b/include/ocl/is_same.hpp
@@ -68,7 +68,7 @@ namespace ocl
T left_ = 127, right_ = 127;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
@@ -84,7 +84,7 @@ namespace ocl
T left_ = 127, right_ = 127;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
@@ -99,11 +99,26 @@ namespace ocl
T left_ = 5, right_ = 3;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
- return left_ / right_ == 1;
+ return (left_ / right_) == 1;
+ }
+ };
+
+ template <typename T>
+ struct equiv_is
+ {
+ private:
+ T left_{}, right_{};
+
+ public:
+ using result_type = bool;
+
+ constexpr result_type hash()
+ {
+ return (left_ / right_);
}
};
} // namespace ocl