hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.4K
active users

Šimon Tóth

The C++23 std::unreachable is a tool for injecting undefined behaviour into a program. A typical use case is in an else branch or the default case of a switch.

Compilers can use this undefined behaviour and optimise the corresponding branch away.

While we can achieve the same behaviour with [[assume(false)]], std::unreachable provides a more readable and logical name.

Compiler Explorer link: compiler-explorer.com/z/xh6h3E