aboutsummaryrefslogtreecommitdiff
path: root/c/common.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-20 02:24:40 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-20 02:24:40 +0200
commit3d56ea09228ac2989eb8b89c8b69909603d61c3e (patch)
tree2deef821cae98df8033c11e452ca063a0caa583f /c/common.h
parent0e8054175d1ba6898830a2df20ea7f6660880f80 (diff)
downloadEpisodeBrowser-3d56ea09228ac2989eb8b89c8b69909603d61c3e.tar.gz
Use template instead of Win32Error::twhat.
Diffstat (limited to 'c/common.h')
-rw-r--r--c/common.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/c/common.h b/c/common.h
index 6b29ed5..d84590d 100644
--- a/c/common.h
+++ b/c/common.h
@@ -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;
}
}