Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I get that covering all bases is good, but am I reading right that this just tells the compiler not to generate that path? Seems like the opposite.

Wouldn't it be safer just to trigger a panic or something?



> Wouldn't it be safer just to trigger a panic or something?

Tradeoffs. The panic can result in a lot of code generation which in turn makes the reachable paths slower. Sure we are talking nanoseconds, but this is C++, if performance isn't important you shouldn't be using C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: