summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt17
-rw-r--r--include/ocl/allocator_op.hpp4
-rw-r--r--include/ocl/basic_hash.hpp2
-rw-r--r--include/ocl/detail/config.hpp4
-rw-r--r--include/ocl/equiv.hpp2
-rw-r--r--include/ocl/io.hpp2
-rw-r--r--include/ocl/option.hpp4
-rw-r--r--include/ocl/print.hpp4
-rw-r--r--include/ocl/smart_ptr.hpp2
-rw-r--r--include/ocl/tracked_ptr.hpp2
-rw-r--r--install_core.cmake16
-rw-r--r--test/option.test.cpp4
12 files changed, 50 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9bde8c2
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,17 @@
+# // ============================================================= //
+# // Open C++ Libraries.
+# // Copyright (C) 2025, Amlal El Mahrouss and OCL Authors, licensed under BSD-3 license.
+# // ============================================================= //
+
+cmake_minimum_required(VERSION 3.30)
+
+project(OCL)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+
+if (INSTALL_OCL)
+ include(install_core.cmake)
+endif()
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 <typename type>
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<Type>{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
diff --git a/install_core.cmake b/install_core.cmake
new file mode 100644
index 0000000..9683385
--- /dev/null
+++ b/install_core.cmake
@@ -0,0 +1,16 @@
+# // ============================================================= //
+# // Open C++ Libraries.
+# // Copyright (C) 2025, Amlal El Mahrouss and OCL Authors, licensed under BSD-3 license.
+# // ============================================================= //
+
+cmake_minimum_required(VERSION 3.30)
+
+project(libocl VERSION 0.1 LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+install(DIRECTORY include/ DESTINATION include)
+
+message(STATUS "OCL.Core has been installed.")
diff --git a/test/option.test.cpp b/test/option.test.cpp
index 0e654b1..1869d24 100644
--- a/test/option.test.cpp
+++ b/test/option.test.cpp
@@ -13,12 +13,12 @@
BOOST_AUTO_TEST_CASE(option_should_fail)
{
- ocl::option opt(ocl::eval_false());
+ ocl::option opt(ocl::eval_false());
BOOST_CHECK_THROW(opt.expect(""), std::exception);
}
BOOST_AUTO_TEST_CASE(option_should_succeed)
{
- ocl::option opt(ocl::eval_true());
+ ocl::option opt(ocl::eval_true());
BOOST_CHECK_NO_THROW(opt.expect(""));
}