From 8535440f6bebdf785683b4a62073f9465ca7e9cc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 17 Nov 2025 10:33:21 +0100 Subject: fix: fixing merge conflicts. Signed-off-by: Amlal El Mahrouss --- dev/examples/opt/opt.cc | 2 +- dev/lib/core/allocator_system.hpp | 2 +- dev/lib/fix/fix.hpp | 6 +++--- dev/lib/logic/opt.hpp | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'dev') 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, delete_op>; } // 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 - 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 + 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 -- cgit v1.2.3