debug: add unhandled
debug function
This commit is contained in:
parent
220e499681
commit
09a624bf88
11
debug.hpp
11
debug.hpp
@ -392,6 +392,17 @@ constexpr void unreachable [[noreturn]] (void);
|
|||||||
constexpr void unreachable [[noreturn]] (const char*);
|
constexpr void unreachable [[noreturn]] (const char*);
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// report a fatal error induced by an unhandled value, especially in switch
|
||||||
|
/// statements. will almost invariably abort the application.
|
||||||
|
template <typename T>
|
||||||
|
constexpr void
|
||||||
|
unhandled [[noreturn]] (T &&t) noexcept
|
||||||
|
{
|
||||||
|
panic ("unhandled value %!", std::forward<T> (t));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void warn (void);
|
void warn (void);
|
||||||
void warn (const std::string&);
|
void warn (const std::string&);
|
||||||
|
Loading…
Reference in New Issue
Block a user