From e476868bdc27ef0e36fc2485606634e7cf2ee00d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 24 Dec 2025 12:41:59 +0100 Subject: feat: new alias for `allocator_op.hpp` pool types. Signed-off-by: Amlal El Mahrouss --- include/ocl/allocator_op.hpp | 6 ++++-- include/ocl/basic_hash.hpp | 4 ++-- include/ocl/detail/config.hpp | 16 ++++++++-------- include/ocl/option.hpp | 2 +- include/ocl/print.hpp | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp index 86bfa56..f40001f 100644 --- a/include/ocl/allocator_op.hpp +++ b/include/ocl/allocator_op.hpp @@ -17,7 +17,8 @@ namespace ocl template struct global_new_op final { - using pointer_type = type*; + using pointer_type = type*; + using const_pointer_type = const type*; auto alloc() -> pointer_type { @@ -41,6 +42,7 @@ namespace ocl struct global_array_delete_op final { using pointer_type = type*; + using const_pointer_type = const type*; auto operator()(pointer_type t) -> void { @@ -48,7 +50,7 @@ namespace ocl } }; - /// \brief Allocator operations structure. Takes care of memory mgmt within a pool. + /// \brief Allocator operations structure. Takes care of memory mgmt within a pool. template class allocator_op { diff --git a/include/ocl/basic_hash.hpp b/include/ocl/basic_hash.hpp index 3704bff..a6978fc 100644 --- a/include/ocl/basic_hash.hpp +++ b/include/ocl/basic_hash.hpp @@ -12,7 +12,7 @@ /// @brief OCL equivalence namespace. namespace ocl { - /// \brief Hash helper. + /// \brief Hash helper. template struct basic_hash { @@ -26,7 +26,7 @@ namespace ocl } }; - /// \brief For all boolean types, return false as they are not hashable + /// \brief For all boolean types, return false as they are not hashable template <> struct basic_hash { diff --git a/include/ocl/detail/config.hpp b/include/ocl/detail/config.hpp index 8ddb7e9..16a74ac 100644 --- a/include/ocl/detail/config.hpp +++ b/include/ocl/detail/config.hpp @@ -55,13 +55,13 @@ namespace ocl { - namespace detail - { - inline void throw_runtime_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) - { - throw std::runtime_error(loc.to_string()); - } - } -} + namespace detail + { + inline void throw_runtime_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) + { + throw std::runtime_error(loc.to_string()); + } + } // namespace detail +} // namespace ocl #endif diff --git a/include/ocl/option.hpp b/include/ocl/option.hpp index 93e01c7..7f66579 100644 --- a/include/ocl/option.hpp +++ b/include/ocl/option.hpp @@ -53,7 +53,7 @@ namespace ocl if (ret_ == return_type::err) { io::println(input ? input : "option::error"); - detail::throw_option_invalid_type_error(); + detail::throw_option_invalid_type_error(); } return *this; diff --git a/include/ocl/print.hpp b/include/ocl/print.hpp index 70b79dd..98c4d6b 100644 --- a/include/ocl/print.hpp +++ b/include/ocl/print.hpp @@ -43,13 +43,13 @@ namespace ocl::io { inline bool is_stdio_sync = true; - using io_error = std::runtime_error; + using io_error = std::runtime_error; inline void throw_option_invalid_type_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) { throw io_error(loc.to_string()); } - } + } // namespace detail inline void enable_stdio_sync(const bool& enable) noexcept { -- cgit v1.2.3