12 Feb
2016
12 Feb
'16
1:26 a.m.
Gavin Lambert wrote:
Again, an assert is a useful tool in debug mode but it disappears in release mode. The only reason to elide this check is for performance.
That's correct.
Then it appears we are in violent agreement after all. :)
No, we aren't. Performance is a legitimate reason to elide the check, but it's not the reason that op* doesn't throw (by contract). Again, throwing on a logic error is an oxymoron. If the function is specified to throw under such-and-such conditions, it's not an error to call it under those conditions. All that seems to deviate a bit from the actual topic of the thread though.