A)
It is usually "bad practice" to keep an assert in release ("assert(false)"), because the code should already have been checked, and you shouldn't pay for the check in release.
BUT: Since the code is theoretically unreachable, there is no real world penalty to the check anyway, so you might put it in anyways, on the off chance it saves your but (IMO).
On Thursday, June 20, 2013 22:21:28 Joseph Rushton Wakeling wrote:Putting it at the end of the function is unnecessary. The compiler already
> In my case it was a bunch of if/else where the program should return from
> one of the blocks. I saw comparable cases in RandomCover with an
> assert(false) at the very end of the function, so thought I'd better tweak
> my code accordingly.
does that for you.
- Jonathan M Davis