diff options
Diffstat (limited to 'dev/lib/logic')
| -rw-r--r-- | dev/lib/logic/opt.hpp | 14 |
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 |
