From ed86aad6d36294e219bc7ffa1f14d2e39fad7ade Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Tue, 18 Nov 2025 18:47:12 -0800 Subject: Tidy --- dxcommon/include/dxcommon.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'dxcommon/include/dxcommon.h') diff --git a/dxcommon/include/dxcommon.h b/dxcommon/include/dxcommon.h index 0270629..e04f8e9 100644 --- a/dxcommon/include/dxcommon.h +++ b/dxcommon/include/dxcommon.h @@ -10,9 +10,10 @@ namespace dx { using Microsoft::WRL::ComPtr; -class exception : public std::exception { +class exception : public std::exception +{ public: - exception() noexcept {} + exception() noexcept = default; exception(HRESULT result, const char* file, int line) noexcept { @@ -25,7 +26,7 @@ public: sprintf_s(m_error, sizeof(m_error), "%s:%d %s", file, line, error); } - const char* what() const noexcept + [[nodiscard]] const char* what() const noexcept final { return m_error; } @@ -36,8 +37,10 @@ private: #define THROW(error) throw exception(error, __FILE__, __LINE__) -#define ThrowIfFailed(result) {\ - if (result != S_OK) {\ +#define ThrowIfFailed(result) \ +{\ + if (result != S_OK) \ + {\ THROW(result);\ }\ } -- cgit v1.2.3