The output of %r on booleans gives 4 bytes, not only one, because the bool is cast to an int before it is formatted. This is inconsistent with other uses of %r (which is yet undocumented). void main() { import std.format : format; assert(format("%r",false) == "\0"); // fails }
@berni44 created dlang/phobos pull request #7946 "Fix Issue 20534 - std.format: %r on boolean gives wrong result" fixing this issue: - Fix Issue 20534 - std.format: %r on boolean gives wrong result https://github.com/dlang/phobos/pull/7946
dlang/phobos pull request #7946 "Fix Issue 20534 - std.format: %r on boolean gives wrong result" was merged into master: - f455389d7f2da3d8ab506a6b4345ca956a32158a by berni44: Fix Issue 20534 - std.format: %r on boolean gives wrong result https://github.com/dlang/phobos/pull/7946