diff options
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; } } |