summaryrefslogtreecommitdiffhomepage
path: root/example/hash_crc32_example
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-17 14:53:59 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-17 14:53:59 +0100
commitd54c2033eaaad5b6f9340b7cbaf8b3b037fb3cbe (patch)
treec9506ad751a589c0a734b26900f48581d1dde2ce /example/hash_crc32_example
parent15aac395a599c92016bd2d74a7c23ca6eea3d04d (diff)
chore: updated file structure.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'example/hash_crc32_example')
-rw-r--r--example/hash_crc32_example/CMakeLists.txt15
-rw-r--r--example/hash_crc32_example/example.cc15
2 files changed, 30 insertions, 0 deletions
diff --git a/example/hash_crc32_example/CMakeLists.txt b/example/hash_crc32_example/CMakeLists.txt
new file mode 100644
index 0000000..cd8d7b5
--- /dev/null
+++ b/example/hash_crc32_example/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+cmake_minimum_required(VERSION 3.15...3.31)
+
+project(
+ HashExample
+ VERSION 1.0
+ LANGUAGES CXX)
+
+find_package(Boost REQUIRED COMPONENTS container)
+
+add_executable(HashExample example.cc)
+
+set_property(TARGET HashExample PROPERTY CXX_STANDARD 20)
+target_include_directories(HashExample PUBLIC ../../include/)
+target_link_libraries(HashExample PRIVATE Boost::container)
diff --git a/example/hash_crc32_example/example.cc b/example/hash_crc32_example/example.cc
new file mode 100644
index 0000000..be6780f
--- /dev/null
+++ b/example/hash_crc32_example/example.cc
@@ -0,0 +1,15 @@
+#include <ocl/crc_hash.hpp>
+#include <ocl/print.hpp>
+#include <ocl/option.hpp>
+
+int main(int argc, char** argv)
+{
+ if (argc != 2) return 1;
+
+ std::hash<ocl::crc_hash_trait> hash{};
+
+ ocl::io::enable_stdio_sync(false);
+ ocl::io::print(hash.operator()<true, false>(argv[1]));
+
+ return 0;
+}