[Issue 12029] Swap on std.container.Array?

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 21 04:54:43 PST 2015


https://issues.dlang.org/show_bug.cgi?id=12029

bb.temp at gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bb.temp at gmx.com
         Resolution|---                         |FIXED

--- Comment #3 from bb.temp at gmx.com ---
swap() now works on Array:

_______________
void main() {
    import std.algorithm;
    import std.container: Array;
    auto arr = Array!int([1, 2]);
    swap(arr[0], arr[1]);
    assert(arr[0] == 2 && arr[1] == 1);
} 
_______________

--


More information about the Digitalmars-d-bugs mailing list