Notes from C++ static analysis
Peter Williams
pwil3058 at bigpond.net.au
Wed Jun 26 20:56:31 PDT 2013
On 27/06/13 12:17, Andrei Alexandrescu wrote:
> On 6/26/13 1:31 PM, Andrej Mitrovic wrote:
>> On 6/26/13, Andrei Alexandrescu<SeeWebsiteForEmail at erdani.org> wrote:
>>> Actually this is good because it allows to customize the format string
>>> to print only a subset of available information (I've actually used
>>> this).
>>
>> Note that this works:
>>
>> writefln("%d", x, x);
>>
>> But the following throws since v2.061:
>>
>> writeln(format("%d", x, x));
>>
>> std.format.FormatException at C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\string.d(2346):
>>
>> Orphan format arguments: args[1..2]
>>
>> I find the latter to be quite useful for debugging code, and wanted
>> this feature for a long time.
>
> I think that's a bug in format that we need to fix.
While you're fixing it can you modify it so that the format string can
specify the order in which the arguments are replaced? This is very
important for i18n. I apologize if it can already do this but I was
unable to find any documentation of format()'s format string other than
examples with %s at the appropriate places.
Peter
More information about the Digitalmars-d
mailing list