[Issue 11782] New: format pointer to range prints range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 19 13:56:14 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11782

           Summary: format pointer to range prints range
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-12-19 13:56:13 PST ---
//----
import std.string;
void main()
{
    auto  a  = iota(0, 10);
    auto  p  = &a;
    writefln("%s", a);
    writefln("%s", p);
}
//----
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
//----

This is not documented behavior. The documented behavior is simply:
"Pointers are formatted as hex integers."

The current behavior (pointer to ranges prints the range) makes no sense to me,
and I don't see why a pointer to such a type would get a special treatment.

I think this behavior is wrong, and should be removed to simply treat the
pointer as a pointer.

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


More information about the Digitalmars-d-bugs mailing list