From 3df7cc4d199c263d5d9a606ddc211f4935d23e4c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 28 Dec 2025 21:50:29 +0100 Subject: feat: API: argument fixes for `throw_*` family of free functions. Signed-off-by: Amlal El Mahrouss --- include/ocl/allocator_op.hpp | 4 +++- include/ocl/basic_hash.hpp | 2 +- include/ocl/detail/config.hpp | 4 +++- include/ocl/equiv.hpp | 2 +- include/ocl/io.hpp | 2 +- include/ocl/option.hpp | 4 ++-- include/ocl/print.hpp | 4 ++-- include/ocl/smart_ptr.hpp | 2 +- include/ocl/tracked_ptr.hpp | 2 +- 9 files changed, 15 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp index c4eea41..954a358 100644 --- a/include/ocl/allocator_op.hpp +++ b/include/ocl/allocator_op.hpp @@ -11,13 +11,15 @@ namespace ocl { - + /// @note these are guidelines on allocating a resource template struct global_new_op final { using pointer_type = type*; using const_pointer_type = const type*; + using pointer = type*; + using const_pointer = const type*; auto alloc() -> pointer_type { diff --git a/include/ocl/basic_hash.hpp b/include/ocl/basic_hash.hpp index 6edfe0b..852e67d 100644 --- a/include/ocl/basic_hash.hpp +++ b/include/ocl/basic_hash.hpp @@ -39,7 +39,7 @@ namespace ocl return false; } }; - + } // namespace ocl #endif diff --git a/include/ocl/detail/config.hpp b/include/ocl/detail/config.hpp index 9afbc22..9df8597 100644 --- a/include/ocl/detail/config.hpp +++ b/include/ocl/detail/config.hpp @@ -58,10 +58,12 @@ namespace ocl namespace detail { - inline void throw_runtime_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) + + inline void throw_runtime_error(const boost::source_location& loc = BOOST_CURRENT_LOCATION) { throw std::runtime_error(loc.to_string()); } + } // namespace detail } // namespace ocl diff --git a/include/ocl/equiv.hpp b/include/ocl/equiv.hpp index a06d6b0..892fe5c 100644 --- a/include/ocl/equiv.hpp +++ b/include/ocl/equiv.hpp @@ -45,7 +45,7 @@ namespace ocl { static constexpr auto value = true; }; - + } // namespace ocl #endif diff --git a/include/ocl/io.hpp b/include/ocl/io.hpp index 7057e5f..f5cf2b5 100644 --- a/include/ocl/io.hpp +++ b/include/ocl/io.hpp @@ -33,7 +33,7 @@ namespace ocl::io inline void_stream void_cout; inline void_stream void_cin; - + } // namespace ocl::io #endif diff --git a/include/ocl/option.hpp b/include/ocl/option.hpp index 04618e9..e137302 100644 --- a/include/ocl/option.hpp +++ b/include/ocl/option.hpp @@ -24,7 +24,7 @@ namespace ocl { using option_error = std::runtime_error; - inline void throw_option_invalid_type_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) + inline void throw_option_invalid_type_error(const boost::source_location& loc = BOOST_CURRENT_LOCATION) { throw option_error(loc.to_string()); } @@ -148,7 +148,7 @@ namespace ocl { return return_type::invalid; } - + } // namespace ocl #endif /* ifndef __OCL_CORE_OPTION */ diff --git a/include/ocl/print.hpp b/include/ocl/print.hpp index fd1a0ea..374a151 100644 --- a/include/ocl/print.hpp +++ b/include/ocl/print.hpp @@ -44,7 +44,7 @@ namespace ocl::io using io_error = std::runtime_error; - inline void throw_option_invalid_type_error(const boost::string_view& loc = BOOST_CURRENT_LOCATION.to_string()) + inline void throw_option_invalid_type_error(const boost::source_location& loc = BOOST_CURRENT_LOCATION) { throw io_error(loc.to_string()); } @@ -76,7 +76,7 @@ namespace ocl::io print(fmt...); lf(); } - + } // namespace ocl::io #endif // ifndef __OCL_CORE_PRINT diff --git a/include/ocl/smart_ptr.hpp b/include/ocl/smart_ptr.hpp index 92c63fe..23400e2 100644 --- a/include/ocl/smart_ptr.hpp +++ b/include/ocl/smart_ptr.hpp @@ -26,7 +26,7 @@ namespace ocl { return shared_ptr{object, boost::null_deleter{}}; } - + } // namespace ocl #endif // ifndef __OCL_SMART_PTR diff --git a/include/ocl/tracked_ptr.hpp b/include/ocl/tracked_ptr.hpp index 30f0913..4c1ab8f 100644 --- a/include/ocl/tracked_ptr.hpp +++ b/include/ocl/tracked_ptr.hpp @@ -231,7 +231,7 @@ namespace ocl detail::throw_tracked_error(); } } - + } // namespace ocl #endif // ifndef __OCL_TRACKED_PTR -- cgit v1.2.3