From 73f13dd60f51ff05e31a64fba89fe31ab3ab185d Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sun, 15 Sep 2019 00:03:11 +0800 Subject: ... --- include/cru/common/base.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/cru/common') 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 + #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 -- cgit v1.2.3