On 02/11/2015 12:52, Jeremy Murphy wrote:
Btw, for anyone else interested, the PR for run-time polynomial division is open: https://github.com/boostorg/math/pull/17
I am a bit conflicted about the question of assert vs exception so wouldn't mind hearing more points of view.
I think the issue is that this is a borderline case. Generally speaking I prefer exceptions plus long-and-tedious error messages, because it reduces the number of "why does your silly code crash" bug reports. Asserts I restrict to invariants in my code. However, any interface that's designed to be used in a tight inner loop should use asserts instead (plus a really big warning in the docs!). Something like vector subscripting is a good example. I'm not sure which this is.... although any usage inside a loop would likely be trivial compared to any mutating operations on the polynomial? John.