C++23's `unreachable()`
https://en.cppreference.com/w/cpp/utility/unreachable
And how does it compare to things we might be currently using like assert(false);, abort(), exit(), etc.
https://compiler-explorer.com/z/13Y87Y3ev
Thanks, played around with that a bit. One thing to be aware of is that std::unreachable() really needs to be unreachable I think?. If you make some mistake and it's not then you get fun ub? https://compiler-explorer.com/z/odahGYnTe
Thanks, played around with that a bit. One thing to be aware of is that std::unreachable() really needs to be unreachable I think?. If you make some mistake and it's not then you get fun ub? https://compiler-explorer.com/z/odahGYnTe
It's explicitly defined as invoking UB, in fact. It feels dangerous to me.
Coming in episode 393