boostorg / boostorg/core

Add `boost::unreachable`

Open
#180 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
156
Forks
116
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.