From 3d56ea09228ac2989eb8b89c8b69909603d61c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jul 2022 02:24:40 +0200 Subject: Use template instead of Win32Error::twhat. --- c/common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'c/common.h') 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 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(xs...); } catch (Win32Error& e) { - EBMessageBox(e.twhat(), TEXT("System Error"), MB_ICONWARNING); + EBMessageBox(e.what(), TEXT("System Error"), MB_ICONWARNING); return (decltype(F(std::declval()...)))NULL; } } -- cgit v1.2.3