formatValue
fn
void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T val, scope const ref FormatSpec!Char f)Formats a value of any type according to a format specifier and writes the result to an output range.
More details about how types are formatted, and how the format specifier influences the outcome, can be found in the definition of a
format string.Parameters
w | an output range where the formatted value is written to |
val | the value to write |
f | a FormatSpec defining the format specifier |
Writer | the type of the output range w |
T | the type of value val |
Char | the character type used for f |
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.
See Also
formattedWrite which formats several values at once.