digitalmars.D.learn - How convert DList!string to string array
- Denis Mezhov (7/7) Feb 15 2014 Please help. How to convert DList!string to string array?
- Timon Gehr (4/11) Feb 15 2014 auto b = a[].array;
- Denis Mezhov (2/18) Feb 15 2014 It works! Thanks for the quick reply.
- Jakob Ovrum (3/19) Feb 15 2014 You can construct containers from ranges directly:
- Timon Gehr (2/5) Feb 15 2014 This seems obvious, but it is not actually true.
- Jakob Ovrum (3/10) Feb 15 2014 It is a defined container primitive. The first one in the table,
- Timon Gehr (3/13) Feb 15 2014 Array does not implement this primitive.
- Jakob Ovrum (4/20) Feb 15 2014 That seems gratuitous. If there's no particular reason it doesn't
- Jesse Phillips (5/21) Feb 15 2014 I just wanted to point out:
Please help. How to convert DList!string to string array? auto a = DList!string(); a.insertFront("123"); a.insertFront("abc"); string[] b = a[]; Array!string c = a[]; Don't work.
Feb 15 2014
On 02/15/2014 05:30 PM, Denis Mezhov wrote:Please help. How to convert DList!string to string array? auto a = DList!string(); a.insertFront("123"); a.insertFront("abc"); string[] b = a[]; Array!string c = a[]; Don't work.auto b = a[].array; Array!string c; c.insertBack(a[]);
Feb 15 2014
On Saturday, 15 February 2014 at 16:38:42 UTC, Timon Gehr wrote:On 02/15/2014 05:30 PM, Denis Mezhov wrote:It works! Thanks for the quick reply.Please help. How to convert DList!string to string array? auto a = DList!string(); a.insertFront("123"); a.insertFront("abc"); string[] b = a[]; Array!string c = a[]; Don't work.auto b = a[].array; Array!string c; c.insertBack(a[]);
Feb 15 2014
On Saturday, 15 February 2014 at 16:38:42 UTC, Timon Gehr wrote:On 02/15/2014 05:30 PM, Denis Mezhov wrote:You can construct containers from ranges directly: auto c = Array!string(a[]);Please help. How to convert DList!string to string array? auto a = DList!string(); a.insertFront("123"); a.insertFront("abc"); string[] b = a[]; Array!string c = a[]; Don't work.auto b = a[].array; Array!string c; c.insertBack(a[]);
Feb 15 2014
On 02/15/2014 06:11 PM, Jakob Ovrum wrote:... You can construct containers from ranges directly: auto c = Array!string(a[]);This seems obvious, but it is not actually true.
Feb 15 2014
On Saturday, 15 February 2014 at 18:14:00 UTC, Timon Gehr wrote:On 02/15/2014 06:11 PM, Jakob Ovrum wrote:It is a defined container primitive. The first one in the table, in fact.... You can construct containers from ranges directly: auto c = Array!string(a[]);This seems obvious, but it is not actually true.
Feb 15 2014
On 02/15/2014 07:23 PM, Jakob Ovrum wrote:On Saturday, 15 February 2014 at 18:14:00 UTC, Timon Gehr wrote:Array does not implement this primitive. http://dpaste.dzfl.pl/a8cb1064bd08On 02/15/2014 06:11 PM, Jakob Ovrum wrote:It is a defined container primitive. The first one in the table, in fact.... You can construct containers from ranges directly: auto c = Array!string(a[]);This seems obvious, but it is not actually true.
Feb 15 2014
On Saturday, 15 February 2014 at 18:30:39 UTC, Timon Gehr wrote:On 02/15/2014 07:23 PM, Jakob Ovrum wrote:That seems gratuitous. If there's no particular reason it doesn't implement it, I would consider it a bug. It is arguably the most basic container primitive.On Saturday, 15 February 2014 at 18:14:00 UTC, Timon Gehr wrote:Array does not implement this primitive. http://dpaste.dzfl.pl/a8cb1064bd08On 02/15/2014 06:11 PM, Jakob Ovrum wrote:It is a defined container primitive. The first one in the table, in fact.... You can construct containers from ranges directly: auto c = Array!string(a[]);This seems obvious, but it is not actually true.
Feb 15 2014
On Saturday, 15 February 2014 at 16:38:42 UTC, Timon Gehr wrote:On 02/15/2014 05:30 PM, Denis Mezhov wrote:I just wanted to point out: auto b = a[].array; That is unrelated to c, which is a conversion to Array, while this is a conversion to an array.Please help. How to convert DList!string to string array? auto a = DList!string(); a.insertFront("123"); a.insertFront("abc"); string[] b = a[]; Array!string c = a[]; Don't work.auto b = a[].array; Array!string c; c.insertBack(a[]);
Feb 15 2014