D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6455 - std.string.format doesn't understand positional arguments
Summary: std.string.format doesn't understand positional arguments
Status: RESOLVED DUPLICATE of issue 4532
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 05:15 UTC by simendsjo
Modified: 2015-06-09 04:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description simendsjo 2011-08-08 05:15:31 UTC
.. At least in 2.054


import std.string;
void main() {
    format("%1$s", "a");
}

std.format.FormatError: std.format string

Using formattedWrite works:

import std.format, std.range;
void main() {
    auto app = appender!string();
    formattedWrite(app, "%1$s", "a");
    assert(app.data == "a");
}
Comment 1 Nick Sabalausky 2011-08-16 12:42:22 UTC

*** This issue has been marked as a duplicate of issue 4532 ***