[Issue 8278] New: std.range.chunks for generic Forward Ranges too?
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 21 12:19:12 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8278
Summary: std.range.chunks for generic Forward Ranges too?
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-06-21 12:21:33 PDT ---
>From the online docs of std.range.chunks:
This range iterates over fixed-sized chunks of size chunkSize of a source
range. Source must be an input range with slicing and length.
Is it possible to modify chunks() to allow it to also work on forward ranges
that have no slicing and lenght?
An example is chunking the output of recurrence():
auto r = recurrence!q{(22695477 * a[n-1] + 12345) % 1073741824}(123456789U);
auto c = std.range.chunks(r, 5);
--
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