Bug 13682 – std.range.isRangeOf?

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-11-04T10:50:00Z
Last change time
2016-04-05T00:30:44Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-11-04T10:50:31Z
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)) {}
Comment #1 by jack — 2016-04-05T00:30:44Z
Marking this as won't fix because of the discussion here: https://github.com/D-Programming-Language/phobos/pull/3786