On Wednesday, 6 August 2014 at 15:02:10 UTC, Matthias Bentrup wrote:
So I take the compiler is allowed to throw away code without any asserts already ?

Yes it can, but only in the cases where it can prove it is the same.

The main difference is that assume does not need to be proved, it is stated to always be true so no proof needed. Some have said that the compiler can still try to prove what it can and issue warnings if it is provable untrue, but it would actually be a little silly on the part of the compiler to waist it's time trying to disprove things it "knows" are true. If it "knows" it is true then why even bother checking?

Reply via email to