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);
        return join(itemstrings, ", ");
    }

    unittest{
        writeln(test(1, 2, 3, 4));
    }

Reply via email to