From b2074916130f1aa06039cd8439d07254c51e9874 Mon Sep 17 00:00:00 2001 From: monarchdodra Date: Fri, 8 Nov 2013 20:47:55 +0100 Subject: [PATCH] fix reg in appender --- std/array.d | 10 ++++++++++ 1 file changed, 10 insertions(+) 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