[Issue 10176] std.array.extend?
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 26 06:21:10 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10176
Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andrej.mitrovich at gmail.com
--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-05-26 06:21:09 PDT ---
Hmm, I would have hoped that 'put' would work here, but it doesn't:
-----
import std.range;
import std.array;
void main()
{
{
Appender!(int[]) arr;
arr.put(iota(5)); // ok
assert(arr.data == [0, 1, 2, 3, 4]);
}
{
int[] arr;
arr.put(iota(5)); // runtime exception
assert(arr == [0, 1, 2, 3, 4]);
}
}
-----
> core.exception.AssertError at C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\array.d(587): Attempting to fetch the front of an empty array of int
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list