Bug 7824 – isInputRange fails to recognize inout(T)[]
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-04T17:01:00Z
Last change time
2012-05-31T04:07:15Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2012-04-04T17:01:11Z
cat > bug.d << CODE
import std.range;
inout(int)[] foo(inout(int)[] range)
{
static assert(isInputRange!(typeof(range)));
return range;
}
CODE
dmd -c bug
--------
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
{
:::
// This test fails, because "inout(int) h = r.front" can
// only be declared in an inout function.
auto h = r.front; // can get the front of the range
}));
}