Skip to content

Commit

Permalink
fix Issue 7824 - isInputRange fails to recognize inout(T)[]
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed May 28, 2012
1 parent ae7c91b commit ed00f6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/range.d
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ calling $(D r.empty) has, or would have, returned $(D false).))
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int _dummy=0)
{
R r = void; // can define a range object
if (r.empty) {} // can test for empty
Expand All @@ -539,6 +540,7 @@ unittest
static assert(isInputRange!(int[]));
static assert(isInputRange!(char[]));
static assert(!isInputRange!(char[4]));
static assert(isInputRange!(inout(int)[])); // bug 7824
}

/**
Expand Down

0 comments on commit ed00f6c

Please sign in to comment.