[Issue 8371] New: Add a function to make a range from a sequence of elements
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 10 13:05:50 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8371
Summary: Add a function to make a range from a sequence of
elements
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: yebblies at gmail.com
ReportedBy: yebblies at gmail.com
--- Comment #0 from yebblies <yebblies at gmail.com> 2012-07-11 06:05:49 EST ---
As mentioned on the newsgroup, it would be useful to have a function in phobos
that can turn a bunch of values into a value type range. What you get when you
cross tuple and chain.
foreach(x; range(23, 7, 1990)) // No allocations, unlike array literals
{
}
It could be a random access range, with slicing.
There's probably not much point in it having assignable elements.
I'll do a pull request for std.range in the next few days.
Name suggested by Andrei.
--
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