Going Loopy

Tim Bray is going Loopy trying to find a way to get around CLR's array bounds checking overhead by trying different C++ expressions.  Short of using unsafe code, there is no reliable way of doing this because no legal sequence of IL bytecodes can ever tell CLR to bypass array bounds-checking.  If there is, then it is a security hole.

However, one can *make it easier* for the JIT implementation to figure out that there is no need for bounds-checking inside a loop by using simpler or more direct expressions like C#'s 'foreach' statement.  Unfortunately, C++ doesn't have an equivalent to foreach.  I use mostly C# in my .NET projects because I found that C# compiler generates more optimized IL bytecodes in general.