www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3567] New: std.traits: Unqual doesn't handle arrays well

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3567

           Summary: std.traits: Unqual doesn't handle arrays well
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: lat7h virginia.edu



12:35:58 PST ---
Phobos' traits.d's Unqual! template (needed for several of its other templates)
does not handle arrays well:

writeln(Unqual!(const(int[])).stringof); // writes const(int)[] not int[]

Adding the following near line 1188 of traits.d solves this problem:

template Unqual(T : U[], U) { alias U[] Unqual; }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 02 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3567


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dsimcha yahoo.com
         Resolution|                            |INVALID



This behavior is by design.  Unqual is supposed to shallowly strip const, etc,
not deeply strip it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 02 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3567




12:46:35 PST ---
Then I propose this design decision ought to be made explicit in the
documentation; "removes all qualifiers" seemed, to me, to imply removing *all*
qualifiers, not just the top level.

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