[Issue 8384] std.conv.to should allow conversion between any pair of string/wstring/dstring/char*/wchar*/dchar*

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 15 13:56:05 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8384



--- Comment #12 from Vladimir Panteleev <thecybershadow at gmail.com> 2012-08-15 13:56:00 PDT ---
I would like to stress out a point that I hope could clear up my view of the
logic that writeln/format should use.

Printing/formatting memory addresses is extremely rarely useful!

Except for some dirty debugging, I can't imagine a case where the user expects
that passing a pointer to something to format would yield the hex
representation of that address.

I believe that printing a pointer as a hex address should be the fallback,
last-resort behavior, if there is no better representation for the said type.
(This also allows discussion of calling toString() on struct pointers.)

For the rare case that the user intends to actually print a pointer, this is
easily accomplished by a cast to size_t and using the appropriate hex format
specifier.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list