D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13682 - std.range.isRangeOf?
Summary: std.range.isRangeOf?
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-04 10:50 UTC by bearophile_hugs
Modified: 2016-04-05 00:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2014-11-04 10:50:31 UTC
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 Jack Stouffer 2016-04-05 00:30:44 UTC
Marking this as won't fix because of the discussion here: https://github.com/D-Programming-Language/phobos/pull/3786