diff options
author | 杨宇千 <crupest@outlook.com> | 2019-09-15 00:03:11 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-09-15 00:03:11 +0800 |
commit | 73f13dd60f51ff05e31a64fba89fe31ab3ab185d (patch) | |
tree | d674041629f328c2357ed85e3e564dec06757f3a /include/cru/common/base.hpp | |
parent | 401ca68f7d9d62d195c558edfeda4ece985805e1 (diff) | |
download | cru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.tar.gz cru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.tar.bz2 cru-73f13dd60f51ff05e31a64fba89fe31ab3ab185d.zip |
...
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 |