Re: range.put() to Empty Array Causes Error?

2018-06-17 Thread Seb via Digitalmars-d-learn
On Sunday, 17 June 2018 at 12:23:55 UTC, Steven Schveighoffer wrote: On 6/17/18 7:07 AM, Vijay Nayar wrote: This code breaks with the following error: void main() { import std.range;   int[] vals = []; vals.put(3); } /src/phobos/std/range/primitives.d(2328): Attempting to fetch

Re: range.put() to Empty Array Causes Error?

2018-06-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/17/18 7:07 AM, Vijay Nayar wrote: This code breaks with the following error: void main() { import std.range;   int[] vals = []; vals.put(3); } /src/phobos/std/range/primitives.d(2328): Attempting to fetch the front of an empty array of int The following code has no error:

range.put() to Empty Array Causes Error?

2018-06-17 Thread Vijay Nayar via Digitalmars-d-learn
This code breaks with the following error: void main() { import std.range; int[] vals = []; vals.put(3); } /src/phobos/std/range/primitives.d(2328): Attempting to fetch the front of an empty array of int The following code has no error: void main() { import