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

           Summary: Make .byValue() and .byKey() of associative arrays
                    adopt the input range interface.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: druntime
        AssignedTo: s...@invisibleduck.org
        ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2010-08-09 10:26:46 PDT ---
Currently .byValue() and .byKey() returns a delegate. This make it only
iterable by foreach, but cannot be used in std.algorithm algorithms, e.g.

----

import std.algorithm;
import std.stdio;
void main () {
   auto x = ["a":4, "b":6];
   writeln( reduce!"a+b"( map!"a*a"( x.byValue() ) ) );
}

----

While it is possible to use .values and .keys, both of these create a copy of
the array, which is unnecessary for many codes like the one above.

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

Reply via email to