summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-17 10:33:21 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-17 10:34:20 +0100
commit8535440f6bebdf785683b4a62073f9465ca7e9cc (patch)
treeb2055ec8ec5f0a1e2387fc8448038d9877df5fbb
parent3827ae4e821ff3758d1eaf2dbacc55a22f802731 (diff)
fix: fixing merge conflicts.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--README.md6
-rw-r--r--dev/examples/opt/opt.cc2
-rw-r--r--dev/lib/core/allocator_system.hpp2
-rw-r--r--dev/lib/fix/fix.hpp6
-rw-r--r--dev/lib/logic/opt.hpp14
5 files changed, 15 insertions, 15 deletions
diff --git a/README.md b/README.md
index 0e876d7..263f494 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
## Brief:
-A C++ library with additional modules for your C++ SDLC. Based on the Open C++ Library.
+A C++ library with additional modules for your C++ SDLC.
## Requirements:
@@ -21,9 +21,9 @@ A C++ library with additional modules for your C++ SDLC. Based on the Open C++ L
int main(int argc, char** argv)
{
- auto opt = ocl::opt(ocl::eval_eq(50, 50)).try_or_throw("ocl::eval_eq, does not match!");
+ auto opt = ocl::opt(ocl::eval_eq(50, 50)).expect("ocl::eval_eq, does not match!");
opt = ocl::opt(ocl::eval_eq(50, 40));
- opt.try_or_throw("this time it doesn't.");
+ opt.expect("this time it doesn't.");
return EXIT_SUCCESS;
}
diff --git a/dev/examples/opt/opt.cc b/dev/examples/opt/opt.cc
index 8a74fa2..b34f2c7 100644
--- a/dev/examples/opt/opt.cc
+++ b/dev/examples/opt/opt.cc
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
ocl::io::println("Testing data...");
auto opt = do_some("Ohio", "Ohio");
- opt.try_or_throw("Checksum failed, Ohio isn't Ohio!");
+ opt.expect("Checksum failed, Ohio isn't Ohio!");
return 0;
diff --git a/dev/lib/core/allocator_system.hpp b/dev/lib/core/allocator_system.hpp
index 6fd0119..1873064 100644
--- a/dev/lib/core/allocator_system.hpp
+++ b/dev/lib/core/allocator_system.hpp
@@ -71,4 +71,4 @@ namespace ocl
using standard_allocator_type = allocator_system<type, new_op<type>, delete_op<type>>;
} // namespace ocl
-#endif // ifndef _OCL_ALLOCATOR_SYSTEM_HPP
+#endif // ifndef _OCL_ALLOCATOR_SYSTEM_HPP \ No newline at end of file
diff --git a/dev/lib/fix/fix.hpp b/dev/lib/fix/fix.hpp
index 243d01c..ddfd9dc 100644
--- a/dev/lib/fix/fix.hpp
+++ b/dev/lib/fix/fix.hpp
@@ -1,8 +1,8 @@
/*
- * File: fix/parser.hpp
+ * File: fix/fix.hpp
* Purpose: Financial Information Exchange parser in C++
* Author: Amlal El Mahrouss (amlal@nekernel.org)
- * Copyright 2025, Amlal El Mahrouss
+ * Copyright 2025, Amlal El Mahrouss, licensed under the MIT license.
*/
#ifndef _OCL_FIX_PARSER_HPP
@@ -212,4 +212,4 @@ namespace ocl::fix
using fix_tag_type = std::uint32_t;
} // namespace ocl::fix
-#endif // ifndef _OCL_FIX_PARSER_HPP
+#endif // ifndef _OCL_FIX_PARSER_HPP \ No newline at end of file
diff --git a/dev/lib/logic/opt.hpp b/dev/lib/logic/opt.hpp
index 137460c..ceee917 100644
--- a/dev/lib/logic/opt.hpp
+++ b/dev/lib/logic/opt.hpp
@@ -28,23 +28,23 @@ namespace ocl
{
}
- template <typename ErrorHandler>
- opt& try_or_handle(const char_type* input)
+ opt& expect(const char_type* input)
{
if (m_ret == return_type::err)
{
- ErrorHandler handler;
- handler(input ? input : "");
+ throw std::runtime_error(input ? input : "opt::error");
}
return *this;
}
- opt& try_or_throw(const char_type* input)
+ template <typename ErrorHandler>
+ opt& expect_or_handle(const char_type* input)
{
if (m_ret == return_type::err)
{
- throw std::runtime_error(input ? input : "");
+ ErrorHandler err_handler;
+ err_handler(input ? input : "opt::error");
}
return *this;
@@ -131,4 +131,4 @@ namespace ocl
}
} // namespace ocl
-#endif /* ifndef _OCL_OPT_HPP */
+#endif /* ifndef _OCL_OPT_HPP */ \ No newline at end of file