David Simcha <> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |
         Resolution|                            |FIXED

--- Comment #1 from David Simcha <> 2010-09-02 20:52:24 PDT ---
Here's the swap algorithm used in the int[] instantiation in std.algorithm:

auto t = a;
a = b;
b = t;

This function is broken for static arrays if a and b are the same array, and in
your example, swap() gets called with the rhs and lhs being the same array. 
This is probably related to using optimized memcpy() routines under the hood
for copying static arrays.  The language should arguably do the right thing
when a static array is assigned to itself instead of this kind of crazy

In the mean time, I've inserted a trivial check into swap() that only gets
compiled in for static arrays.  It's a kludge, but it's a trivial,
well-encapsulated kludge and can be removed when the deeper issue gets solved.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to