diff options
Diffstat (limited to 'include/cru/common/base.hpp')
-rw-r--r-- | include/cru/common/base.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cru/common/base.hpp b/include/cru/common/base.hpp index 920fe569..55f43e5c 100644 --- a/include/cru/common/base.hpp +++ b/include/cru/common/base.hpp @@ -1,6 +1,8 @@ #pragma once #include "pre_config.hpp" +#include <stdexcept> + #define CRU_DEFAULT_COPY(classname) \ classname(const classname&) = default; \ classname& operator=(const classname&) = default; @@ -36,4 +38,8 @@ struct Interface { Interface& operator=(Interface&& other) = delete; virtual ~Interface() = default; }; + +[[noreturn]] inline void UnreachableCode() { + throw std::runtime_error("Unreachable code."); +} } // namespace cru |