[Issue 13682] New: std.range.isRangeOf?
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Nov 4 02:50:31 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13682
Issue ID: 13682
Summary: std.range.isRangeOf?
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
Sometimes I have a function that just needs an iterable (sometimes and
opApply-based iterable is OK too, but this is enhahcement request is just for
ranges):
void foo(Range)(Range data)
if (isForwardRange!Range && is(Unqual!(ForeachType!Range) ==
int)) {}
So perhaos it's a good idea to add a simple "isRangeOf" template to Phobos:
void foo(Range)(Range data)
if (isRangeOf!(Range, int)) {}
--
More information about the Digitalmars-d-bugs
mailing list