Re: container vs standard array

2023-09-19 Thread vino via Digitalmars-d-learn
On Tuesday, 19 September 2023 at 20:20:17 UTC, Nick Treleaven wrote: On Tuesday, 19 September 2023 at 19:57:34 UTC, Nick Treleaven wrote: This is because a single array can be passed to a typesafe variadic parameter rather than elements of that array type. And then immutable(char) doesn't conve

Re: container vs standard array

2023-09-19 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 19 September 2023 at 19:57:34 UTC, Nick Treleaven wrote: This is because a single array can be passed to a typesafe variadic parameter rather than elements of that array type. And then immutable(char) doesn't convert to string. I think a non-variadic overload could be added to make

Re: container vs standard array

2023-09-19 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 19 September 2023 at 06:35:01 UTC, JG wrote: On Tuesday, 19 September 2023 at 00:34:01 UTC, vino wrote: //auto a = Array!string("Aname"); // throws error auto b = Array!char("Bname");// works auto c = Array!string("Aname", "Bname"); // works ... Looks

Re: container vs standard array

2023-09-18 Thread JG via Digitalmars-d-learn
On Tuesday, 19 September 2023 at 00:34:01 UTC, vino wrote: Hi All, I am trying to understand as to why the below code is throwing error Code ``` import std.stdio: writeln; import std.container.array; void main () { //auto a = Array!string("Aname"); // throws error auto b = Array