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

           Summary: relax inout rules
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-12-13 11:28:26 PST ---
Currently, DMD requires that the return type of a function that has
inout-qualified parameters is itself qualified with inout. Removing this
restriction would make the type system more expressive.

For example, the following function still requires code duplication to work for
multiple differently qualified parameters:

void copy(int** tgt, int* src){ *tgt = src; }
void copy(immutable(int)** tgt, immutable(int)* src){ *tgt = src; }
void copy(const(int)** tgt, const(int)* src){ *tgt = src; }

With the lifted restriction, these three overloads can be merged:

void copy(inout(int)** tgt, inout(int)* src){ *tgt = src; }


Also see the newsgroup discussion on the topic:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=151839

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

Reply via email to