4 ms·
Since dying is a valid implementation of UB, I don't see a problem. It's definitely better than memory corruption. In general my preferred way to handle OOB is
by CodesInChaos 3y ago
Since dying is a valid implementation of UB, I don't see a problem. It's definitely better than memory corruption.
In general my preferred way to handle OOB is an unchecked exception (like in Rust or C#), but that's not really an option C.