5 template <typename ExceptionTag> class ExceptionT : public std::exception
8 typedef ExceptionTag tag;
9 explicit ExceptionT(const std::wstring& reason)
13 const wchar_t * what() {return m_reason.c_str();};
14 const std::wstring& what_str() { return m_reason;};
16 std::wstring m_reason;
19 #define DefineException(x) struct x {}; typedef ExceptionT<x> x## Exception;
21 inline void ThrowIfErr(HRESULT hr) {if(hr != S_OK){throw Platform::Exception::CreateException(hr);}}