On Friday, 16 December 2016 at 10:28:03 UTC, qznc wrote:
On Thursday, 15 December 2016 at 18:48:22 UTC, Andrei Alexandrescu wrote:
https://issues.dlang.org/show_bug.cgi?id=16975

Whenever I think about preconditions and speed, I think that they should actually be put into the caller instead of into the function/callee.

Not only faster, but this is the right thing to do. Failing precondition is a caller error, not a callee.

Beside optimization:
 - The error will be reported at the right place.
- The compilation flags of the caller decide if the contract is checked, not the callee.

Reply via email to