[Issue 9491] New: allow for insert/return pointer to existing value if present on assoc array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 9 11:18:09 PST 2013


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

           Summary: allow for insert/return pointer to existing value if
                    present on assoc array
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: dbdavidson at yahoo.com


--- Comment #0 from Daniel Davidson <dbdavidson at yahoo.com> 2013-02-09 11:18:08 PST ---
By providing something like:

auto ptrToValue = hash.insertDefaultOrFind(key, init)
*ptrToValue += additional;

client code can perform an <insert if not present/lookup> combined so that on
the
case of a nonexistent key, 1 toHash/lookup can be done instead of 3.

The best recap of what is needed is in this thread:
http://forum.dlang.org/post/mailman.1081.1360269373.22503.digitalmars-d-learn@puremagic.com

-- 
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