Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boost::unreachable #180

Open
denzor200 opened this issue Dec 13, 2024 · 0 comments
Open

Add boost::unreachable #180

denzor200 opened this issue Dec 13, 2024 · 0 comments

Comments

@denzor200
Copy link

C++11 users need an analogue of std::unreachable. Might be easily implemented in the way cppreference suggests:

[[noreturn]] inline void unreachable()
{
#if defined(_MSC_VER) && !defined(__clang__) // MSVC
    __assume(false);
#else // GCC, Clang
    __builtin_unreachable();
#endif
}

https://en.cppreference.com/w/cpp/utility/unreachable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant