diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-20 02:24:40 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-20 02:24:40 +0200 |
commit | 3d56ea09228ac2989eb8b89c8b69909603d61c3e (patch) | |
tree | 2deef821cae98df8033c11e452ca063a0caa583f /c/common.h | |
parent | 0e8054175d1ba6898830a2df20ea7f6660880f80 (diff) | |
download | EpisodeBrowser-3d56ea09228ac2989eb8b89c8b69909603d61c3e.tar.gz |
Use template instead of Win32Error::twhat.
Diffstat (limited to 'c/common.h')
-rw-r--r-- | c/common.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -17,8 +17,8 @@ struct Win32Error : public std::exception { Win32Error(DWORD dwErr); ~Win32Error(); - virtual const char* what() const noexcept override; - virtual const TCHAR* twhat() const noexcept; + template <typename T = char> const T* what() const noexcept; + private: DWORD m_dwErr; char* m_szMsg = NULL; @@ -69,7 +69,7 @@ inline auto prefer(T... xs) try { return require<F>(xs...); } catch (Win32Error& e) { - EBMessageBox(e.twhat(), TEXT("System Error"), MB_ICONWARNING); + EBMessageBox(e.what<TCHAR>(), TEXT("System Error"), MB_ICONWARNING); return (decltype(F(std::declval<T>()...)))NULL; } } |