From ecd5a1de11869d2bc9ddc796068decb2eebffdc2 Mon Sep 17 00:00:00 2001 From: Andrei Alexandrescu Date: Sat, 11 Jul 2009 18:59:26 +0000 Subject: [PATCH] fixed unlisted bug in documentation --- std/format.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/std/format.d b/std/format.d index 89f496146..3757ce39b 100644 --- a/std/format.d +++ b/std/format.d @@ -2131,10 +2131,10 @@ import std.format; string myFormat(A...)(A args) { - StringWriter!(char) writer; + Appender!(string) writer; std.format.formattedWrite(writer, "%s et %s numeris romanis non sunt", args); - return writer.backend; + return writer.data; } ... int x = 42; @@ -2146,9 +2146,9 @@ opengroup.org/onlinepubs/009695399/functions/printf.html, POSIX) style. Example: ------------------------- -StringWriter!(char) writer; +Appender!(string) writer; std.format.formattedWrite(writer, "Date: %2$s %1$s", "October", 5); -assert(writer.backend == "Date: 5 October"); +assert(writer.data == "Date: 5 October"); ------------------------ The positional and non-positional styles can be mixed in the same