On 5/24/16 4:03 PM, pineapple wrote:
I would've expected this to work, but instead I get a compile error. Is
my syntax wrong? Is this just not a case that map can handle, and I
should be doing something else?
import std.algorithm : map;
import std.conv : to;
import std.stdio : writeln;
import std.string : join;
string test(Args...)(in Args items){
immutable string[items.length] itemstrings =
map!(to!string)(items);
Slice assignment from range to array is not supported.
In your example, I'm curious why the efforts to specify the type? I
think it would work with just saying auto itemstrings = ...
-Steve