diff --git a/std/array.d b/std/array.d index c30d554c03a..f97ad078bef 100644 --- a/std/array.d +++ b/std/array.d @@ -2361,6 +2361,7 @@ struct Appender(A : T[], T) emplace(&it, items.front); else it = items.front; + items.popFront(); } } else @@ -2372,6 +2373,7 @@ struct Appender(A : T[], T) emplace(&it, getUItem(items.front)); else it = getUItem(items.front); + items.popFront(); } } @@ -2874,6 +2876,14 @@ unittest assert(app3.data == [1, 2, 3]); } +unittest +{ + Appender!(int[]) app; + short[] range = [1, 2, 3]; + app.put(range); + assert(app.data == [1, 2, 3]); +} + /* A simple slice type only holding pointers to the beginning and the end of an array. Experimental duplication of the built-in slice - do not