formatted

Constructs a stringifiable object from a value (i.e., a lazily formatted object). Combines formattingFunctor and stringifiable.

formatted
(
string fmt = null
T...
)
(
auto ref T values
)

Examples

import std.conv : text;
import std.format : format;
assert(formatted(5).text == "5");
assert(formatted!"%03d"(5).text == "005");
assert(format!"%s%s%s"("<", formatted!"%x"(64), ">") == "<40>");
assert(format!"<%03d>"(formatted(5)) == "<005>");

Meta