std.string.format results in run-time exception
d coder
dlang.coder at gmail.com
Sat Jun 30 11:06:23 PDT 2012
Greetings
std.string.format throws runtime exception for BigInt and for BitArray
types even though writefln works fine. The run-time error says
std.format.FormatException at std/format.d(4744): Can't convert
std.bigint.BigInt to string: "string toString()" not defined
Here is a small test case.
Regards
- Puneet
void main()
{
import std.stdio;
import std.string;
import std.bigint;
import std.bitmanip;
BigInt aa = 100;
BitArray bb;
bb.init([true, false]);
writefln("%x", aa);
writefln("%x", bb);
writeln(format("%x", aa));
writeln(format("%x", bb));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120630/46257a0a/attachment.html>
More information about the Digitalmars-d
mailing list