diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:56:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-18 07:56:32 +0100 |
| commit | 4fd646501b75cb1d94a6e17d2387372d72ce797b (patch) | |
| tree | b9b6d442f8a92fea4c8943a1504dba105b133596 /dev/lib/core | |
| parent | d6d127aefb6819fa97ef11aef0998c03a3aad88e (diff) | |
| parent | 9eec329ebdf4cf079619edb58dbcd78ce42b8626 (diff) | |
Merge pull request #10 from amlel-el-mahrouss/develop
fix: IO and FIX modules.
Diffstat (limited to 'dev/lib/core')
| -rw-r--r-- | dev/lib/core/error_handler.hpp | 13 | ||||
| -rw-r--r-- | dev/lib/core/includes.hpp | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/dev/lib/core/error_handler.hpp b/dev/lib/core/error_handler.hpp index 67bf7b4..4234721 100644 --- a/dev/lib/core/error_handler.hpp +++ b/dev/lib/core/error_handler.hpp @@ -23,7 +23,18 @@ namespace ocl basic_error_handler& operator=(const basic_error_handler&) = delete; basic_error_handler(const basic_error_handler&) = delete; - virtual void operator()(const std::basic_string<char>& msg) + template <bool throw_too = false> + void error(const std::basic_string<char>& msg) + { + this->operator()(msg); + + if constexpr (throw_too) + { + throw std::runtime_error(msg); + } + } + + void operator()(const std::basic_string<char>& msg) { ocl::io::print(msg); } diff --git a/dev/lib/core/includes.hpp b/dev/lib/core/includes.hpp index ff59535..78eccd3 100644 --- a/dev/lib/core/includes.hpp +++ b/dev/lib/core/includes.hpp @@ -12,3 +12,12 @@ #include <boost/core/demangle.hpp> #include <boost/core/null_deleter.hpp> #include <boost/container/allocator.hpp> + +namespace ocl +{ +#ifdef OCL_USE_UTF8 + using char_type = char8_t; +#else + using char_type = char; +#endif +} // namespace ocl
\ No newline at end of file |
