Summary: Length for Ranges
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P4
         Component: Phobos

Kind of a meta-enhancement, but it would be nice if all of the generic range
types in std.range and std.algorithm would try to have length properties if the
range that they're wrapping does.  For example, as far as I can tell, it
wouldn't be hard to make Map have a length property that forwards to the
underlying range's length property if it exists.

This would primarily be useful when copying generic ranges to an array, as this
can be done much more efficiently if the length is known ahead of time and the
array can be allocated exactly once, rather than appending.


Reply via email to