On 1/30/18 2:19 PM, cc wrote:
Still doesn't work without the cast it seems..

     auto rng = str[];
     rng.sformat!"%s:%s"("some", "string");
    // Error: template std.format.sformat cannot deduce function from argument types !("%s:%s")(RangeT!(Array!char), string, string)

I misunderstood what you were trying to do. I thought you were just trying to get a valid range, missed the requirement that the range works with sformat (obviously from the subject! sorry).

Indeed, there isn't a way to extract an actual char[] from Array (and this is intentional).

But as Seb says, you can use formattedWrite:

auto rng = str[];
rng.formattedWrite("%s:%s", "some", "string");

-Steve

Reply via email to