diff options
author | crupest <crupest@outlook.com> | 2018-11-05 20:54:48 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-11-05 20:54:48 +0800 |
commit | 1dab244aaad8694ba37ef43caedd8c8ba0310c00 (patch) | |
tree | f70f6489a0f88520a0bdc095cd9713d03f83687b /src/exception.h | |
parent | 252519effe30881825dd02e26dc41bd9cde34782 (diff) | |
download | cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.gz cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.bz2 cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.zip |
...
Diffstat (limited to 'src/exception.h')
-rw-r--r-- | src/exception.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/exception.h b/src/exception.h index 6749b684..ae9457e7 100644 --- a/src/exception.h +++ b/src/exception.h @@ -2,7 +2,6 @@ #include "system_headers.h" #include <optional> -#include <string_view> #include "base.h" @@ -11,7 +10,7 @@ namespace cru { class HResultError : public std::runtime_error { public: - explicit HResultError(HRESULT h_result, std::optional<std::string_view> additional_message = std::nullopt); + explicit HResultError(HRESULT h_result, std::optional<MultiByteStringView> additional_message = std::nullopt); HResultError(const HResultError& other) = default; HResultError(HResultError&& other) = default; HResultError& operator=(const HResultError& other) = default; @@ -32,7 +31,7 @@ namespace cru { throw HResultError(h_result); } - inline void ThrowIfFailed(const HRESULT h_result, const std::string_view& message) { + inline void ThrowIfFailed(const HRESULT h_result, const MultiByteStringView& message) { if (FAILED(h_result)) throw HResultError(h_result, message); } @@ -40,7 +39,7 @@ namespace cru { class Win32Error : public std::runtime_error { public: - explicit Win32Error(DWORD error_code, std::optional<std::string_view> additional_message = std::nullopt); + explicit Win32Error(DWORD error_code, std::optional<MultiByteStringView> additional_message = std::nullopt); Win32Error(const Win32Error& other) = default; Win32Error(Win32Error&& other) = default; Win32Error& operator=(const Win32Error& other) = default; |