From 4de14ab4c993072ab8d2156f3455f60f4adea448 Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Mon, 26 Jun 2017 10:54:39 -0400 Subject: [PATCH] Change opOpAssign to use auto ref to prevent copying static arrays --- std/container/array.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/container/array.d b/std/container/array.d index 654c457090b..aaa0111908e 100644 --- a/std/container/array.d +++ b/std/container/array.d @@ -727,7 +727,7 @@ if (!is(Unqual!T == bool)) /** * Forwards to `insertBack`. */ - void opOpAssign(string op, Stuff)(Stuff stuff) + void opOpAssign(string op, Stuff)(auto ref Stuff stuff) if (op == "~") { static if (is(typeof(stuff[])) && isImplicitlyConvertible!(typeof(stuff[0]), T))