Notes from C++ static analysis

Peter Williams pwil3058 at bigpond.net.au
Wed Jun 26 22:35:41 PDT 2013


On 27/06/13 14:20, H. S. Teoh wrote:
> On Thu, Jun 27, 2013 at 01:56:31PM +1000, Peter Williams wrote:
> [...]
>> 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.
> [...]
>
> You can use positional arguments for this purpose. For example:
>
> 	writefln("%2$s %1$s", "a", "b");
>
> outputs "b a".

Yes, I eventually found the documentation in std.format while I expected 
it to be in std.string along with the documentation the format() 
function.  A reference to std.format in the documentation for format() 
(in std.string) would be nice.

Peter



More information about the Digitalmars-d mailing list