Created
November 27, 2022 07:11
-
-
Save aprotyas/803dcf949e66da530fe1633e6659a454 to your computer and use it in GitHub Desktop.
std::unreachable C++17 implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace std { | |
[[noreturn]] inline void unreachable() { | |
#ifdef __GNUC__ | |
__builtin_unreachable(); | |
#elif defined _MSC_VER | |
__assume(false); | |
#endif | |
} | |
} // namespace std |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment