summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-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
4 files changed, 12 insertions, 12 deletions
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