Skip to content

Commit

Permalink
Merge pull request #3495 from burner/array_remove_workaround
Browse files Browse the repository at this point in the history
std.container.array remove workaround
  • Loading branch information
schveiguy committed Jul 16, 2015
2 parents c17c14d + 8f937b1 commit 984b734
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions std/container/array.d
Expand Up @@ -637,9 +637,7 @@ stuff)
{
// TODO: optimize
Array result;
// @@@BUG@@ result ~= this[] doesn't work
auto r = this[];
result ~= r;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
Expand Down Expand Up @@ -1003,9 +1001,9 @@ unittest
auto a = Array!int(1, 2, 3);
auto b = Array!int(11, 12, 13);
auto c = a ~ b;
//foreach (e; c) writeln(e);
assert(c == Array!int(1, 2, 3, 11, 12, 13));
//assert(a ~ b[] == Array!int(1, 2, 3, 11, 12, 13));
assert(a ~ b[] == Array!int(1, 2, 3, 11, 12, 13));
assert(a ~ [4,5] == Array!int(1,2,3,4,5));
}

unittest
Expand Down

0 comments on commit 984b734

Please sign in to comment.