diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-07 15:30:08 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-07 15:30:08 -0500 |
| commit | a2987feb8cb486c2ff124669190c1abd4e80a8f9 (patch) | |
| tree | 5970f9fae53f9f95ae897ea787f3b6ed52fc1a4a /include | |
| parent | acab3c4d9e5181dbd16790b9e2eb787d30bd946f (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')
| -rw-r--r-- | include/ocl/allocator_op.hpp | 2 | ||||
| -rw-r--r-- | include/ocl/is_same.hpp | 23 | ||||
| -rw-r--r-- | include/ocl/unique_ptr.hpp | 20 |
3 files changed, 40 insertions, 5 deletions
diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp index 9092800..eff3bac 100644 --- a/include/ocl/allocator_op.hpp +++ b/include/ocl/allocator_op.hpp @@ -1,6 +1,6 @@ /* * File: allocator_op.hpp - * Purpose: Allocator Operations container. + * Purpose: Allocate from a pool. * Author: Amlal El Mahrouss (amlal@nekernel.org) * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license */ 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 diff --git a/include/ocl/unique_ptr.hpp b/include/ocl/unique_ptr.hpp new file mode 100644 index 0000000..253fc0a --- /dev/null +++ b/include/ocl/unique_ptr.hpp @@ -0,0 +1,20 @@ +/* + * File: unique_pr.hpp + * Purpose: Unique Pointer helpers. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license + */ + +#ifndef __OCL_UNIQUE_PTR +#define __OCL_UNIQUE_PTR + +#include <ocl/detail/config.hpp> +#include <memory> + +namespace ocl +{ + template<class T, class Del> + using unique_ptr = std::unique_ptr<T, Del>; +} + +#endif // ifndef __OCL_UNIQUE_PTR
\ No newline at end of file |
