summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/logic/opt.hpp
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 /dev/lib/logic/opt.hpp
parent3827ae4e821ff3758d1eaf2dbacc55a22f802731 (diff)
fix: fixing merge conflicts.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/logic/opt.hpp')
-rw-r--r--dev/lib/logic/opt.hpp14
1 files changed, 7 insertions, 7 deletions
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