Re: Auto and empty array

2014-06-30 Thread w0rp via Digitalmars-d
On Monday, 30 June 2014 at 05:39:38 UTC, Igor wrote: In case I want to create a new array with size I know, it's very convenient to use auto: auto a = new int[](13); But if I want to create a new, empty array? Then using auto is not convenient and I have: auto a = new int[](0); It seems a bit

Re: Auto and empty array

2014-06-30 Thread Daniel Murphy via Digitalmars-d
Igor wrote in message news:dladvaltigiapekur...@forum.dlang.org... It seems a bit bloated, compared to int[] a = []. I like using auto because of uniform syntax and other reasons. Is there any concise way to create a new empty array with auto? auto a = (int[]).init;

Re: Auto and empty array

2014-06-30 Thread Daniel Kozak via Digitalmars-d
V Mon, 30 Jun 2014 05:39:36 + Igor via Digitalmars-d digitalmars-d@puremagic.com napsáno: In case I want to create a new array with size I know, it's very convenient to use auto: auto a = new int[](13); But if I want to create a new, empty array? Then using auto is not convenient and I

Re: Auto and empty array

2014-06-30 Thread Daniel Kozak via Digitalmars-d
V Mon, 30 Jun 2014 05:39:36 + Igor via Digitalmars-d digitalmars-d@puremagic.com napsáno: In case I want to create a new array with size I know, it's very convenient to use auto: auto a = new int[](13); But if I want to create a new, empty array? Then using auto is not convenient and I

Auto and empty array

2014-06-29 Thread Igor via Digitalmars-d
In case I want to create a new array with size I know, it's very convenient to use auto: auto a = new int[](13); But if I want to create a new, empty array? Then using auto is not convenient and I have: auto a = new int[](0); It seems a bit bloated, compared to int[] a = []. I like using auto