Swift has this and this is <i>a</i> sensible way to go but not the only one.<p>I personally would prefer integer overflow resulting in NaN like it does with IEEE floating point operations. Regher has written about this option a bit more in [1].
On the other hand, as long as we have no hardware support this is not going to fly.<p>If we consider current popular hardware as given, want to be as safe as possible while still retaining performance competitive with C&#x2F;C++ the solution the Rust community chose is a very good one and one I can live with.<p>[1] <a href="http:&#x2F;&#x2F;blog.regehr.org&#x2F;archives&#x2F;641" rel="nofollow">http:&#x2F;&#x2F;blog.regehr.org&#x2F;archives&#x2F;641</a>