summaryrefslogtreecommitdiffhomepage
path: root/include/ocl/is_same.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-15 16:57:12 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-15 16:57:12 +0100
commit7096a2b477782db54d9e0829b6ad7c6a3314dc2c (patch)
tree1d9b126d1f2aa3c749242217b37962391695327d /include/ocl/is_same.hpp
parent0424f52c142e64cfadaa37288feee775fafc2bf0 (diff)
chore: new elements and breaking API changes in is_same, option.hpp.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl/is_same.hpp')
-rw-r--r--include/ocl/is_same.hpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/include/ocl/is_same.hpp b/include/ocl/is_same.hpp
index 57d372b..519a87b 100644
--- a/include/ocl/is_same.hpp
+++ b/include/ocl/is_same.hpp
@@ -19,8 +19,8 @@ namespace ocl
using result_type = typename T::result_type;
using type = T;
- /// @brief hash from T's result_type.
- static result_type hash()
+ // AMLALE: If it throws, we can't compute the hash correctly.
+ static constexpr result_type hash() noexcept
{
return T{}.hash();
}
@@ -61,10 +61,7 @@ namespace ocl
{
using result_type = bool;
- constexpr result_type hash()
- {
- return sizeof(T) == 1;
- }
+ static constexpr auto value = sizeof(T) == 1;
};
template <typename T>
@@ -72,10 +69,7 @@ namespace ocl
{
using result_type = bool;
- constexpr result_type hash()
- {
- return sizeof(T) > 1;
- }
+ static constexpr auto value = sizeof(T) > 1;
};
template <typename T>
@@ -83,10 +77,7 @@ namespace ocl
{
using result_type = bool;
- constexpr result_type hash()
- {
- return sizeof(T) >= 4;
- }
+ static constexpr auto value = sizeof(T) >= 4;
};
template <typename L, typename R>
@@ -96,10 +87,7 @@ namespace ocl
using left_type = L;
using right_type = R;
- constexpr result_type hash()
- {
- return false;
- }
+ static constexpr auto value = false;
};
template <typename L>
@@ -109,10 +97,7 @@ namespace ocl
using left_type = L;
using right_type = L;
- constexpr result_type hash()
- {
- return true;
- }
+ static constexpr auto value = true;
};
} // namespace ocl