[*] Update AU_THROW_STRING to throw an exception when possible
This commit is contained in:
parent
4fa7f61b8f
commit
f4f98cec83
@ -136,8 +136,30 @@
|
||||
#define AU_FWD(var) AuForward<decltype(var)>(var)
|
||||
#endif
|
||||
|
||||
#if defined(_AURORA_MISSING_STD_EXCEPTION)
|
||||
|
||||
#define AuStringException AuString
|
||||
|
||||
#else
|
||||
|
||||
struct AuStringException : std::exception
|
||||
{
|
||||
inline AuStringException (const char *str) : pNullString(str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char *what() const noexcept override
|
||||
{
|
||||
return pNullString;
|
||||
}
|
||||
|
||||
const char *pNullString;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(AU_THROW_STRING)
|
||||
#define AU_THROW_STRING(var) throw AuString(var)
|
||||
#define AU_THROW_STRING(var) throw AuStringException(var)
|
||||
#endif
|
||||
|
||||
#define AU_ITERATE_ARRAY(index, arry) AuUInt index = 0; index < AuArraySize(arry); index++
|
||||
|
@ -70,4 +70,6 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define _AURORA_NULLEXPT_USE_TRY_EMPLACE_AFTER_FIND
|
||||
//#define _AURORA_NULLEXPT_USE_TRY_EMPLACE_AFTER_FIND
|
||||
|
||||
//#define _AURORA_MISSING_STD_EXCEPTION
|
Loading…
Reference in New Issue
Block a user