debug: add unhandled debug function

This commit is contained in:
Danny Robson 2017-09-17 12:41:23 +10:00
parent 220e499681
commit 09a624bf88

View File

@ -392,6 +392,17 @@ constexpr void unreachable [[noreturn]] (void);
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 (const std::string&);