Comment #0 by bearophile_hugs — 2013-02-25T18:48:32Z
import std.stdio: writeln, writefln;
import std.typecons: tuple;
void main() {
auto s = "hello";
writefln(">%40s<", s);
writefln(">%-40s<", s);
auto t = tuple("hello");
writefln(">%40s<", t);
writefln(">%-40s<", t);
}
dmd 2.063alpha prints:
> hello<
>hello <
>Tuple!(string)("hello")<
>Tuple!(string)("hello")<
But maybe it should print:
> hello<
>hello <
> Tuple!(string)("hello")<
>Tuple!(string)("hello") <
--------------------
Note: currently this code doesn't give an error, I don't know if this is correct:
import std.stdio: writefln;
void main() {
auto s = "hello";
writefln(">%-s<", s);
}
It prints:
>hello<
dlang/phobos pull request #7254 "Fix Issue 9592 - Justified Tuple printing" was merged into master:
- 779b9cb53cfafeb5ba1d5fd9aac53489b4731a15 by Bernhard Seckinger:
Fix Issue 9592 - Justified Tuple printing
https://github.com/dlang/phobos/pull/7254
Comment #3 by petar.p.kirov — 2019-10-28T05:52:10Z
Pull request https://github.com/dlang/phobos/pull/7254 addressed part of the issues with this bug, but there are some remaining (check the PR description for details).
Comment #4 by bugzilla — 2019-12-12T12:06:48Z
*** This issue has been marked as a duplicate of issue 7341 ***