Pedro Rodrigues: > The fact that 'i' and 'j' are deduced to type 'uint' in the second > version. That's the kind of bug that would keep me up at night.
Almost right answer. i and j are size_t, that is not uint in 64 bit compilations. Unsigned numbers cause the (i-j) sub-expression to give wrong results. ------------------------ Moritz Warning: > I wonder, can there be done smth. on behalf of the language to prevent > this kind of bug? Two possible solutions, both refused by Walter: - Dmd may use signed word for array indexes and lenghts. - dmd may introduce runtime overflows. Bye, bearophile
