arguments are used, this is the number of arguments that where formatted.
formattedWrite
fn
uint formattedWrite(Writer, Char, Args...)(auto ref Writer w, const scope Char[] fmt, Args args)Converts its arguments according to a format string and writes the result to an output range.
The second version of formattedWrite takes the format string as a template argument. In this case, it is checked for consistency at compile-time.
Parameters
w | an output range, where the formatted result is written to |
fmt | a format string |
args | a variadic list of arguments to be formatted |
Writer | the type of the writer w |
Char | character type of fmt |
Args | a variadic list of types of the arguments |
Returns
The index of the last argument that was formatted. If no positional
Throws
A FormatException
if formatting did not succeed.
Note
In theory this function should be
@nogc. But with the current
implementation there are some cases where allocations occur. See sformat for more details.
fn
uint formattedWrite(alias fmt, Writer, Args...)(auto ref Writer w, Args args) if (isSomeString!(typeof(fmt)))ditto