aboutsummaryrefslogtreecommitdiff
path: root/c/common.h
diff options
context:
space:
mode:
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;
}
}