Checked.toString

Writes a string representation of this to a sink.

struct Checked(T, Hook = Abort)
const
void
toString
(
Writer
Char
)
(
scope ref Writer sink
,
scope const ref FormatSpec!Char fmt
)
if (
is(T == Checked!(U, H),
U
H
)
)

Parameters

sink Writer

A Char accepting output range.

fmt FormatSpec!Char

A std.format.FormatSpec which controls how this is formatted.

Examples

toString is rarely directly invoked; the usual way of using it is via std.format.format:

import std.format;

assert(format("%04d", checked(15)) == "0015");
assert(format("0x%02x", checked(15)) == "0x0f");

Meta