Skip to content

Commit

Permalink
Change C++ style CT test to D style, make unittests CT
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sh committed Apr 7, 2012
1 parent 8fda49a commit 92ea494
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/range.d
Expand Up @@ -1188,16 +1188,16 @@ struct MyInfiniteRange

template isInfinite(R)
{
static if (isInputRange!R && is(char[1 + R.empty]))
static if (isInputRange!R && __traits(compiles, { enum e = R.empty; }))
enum bool isInfinite = !R.empty;
else
enum bool isInfinite = false;
}

unittest
{
assert(!isInfinite!(int[]));
assert(isInfinite!(Repeat!(int)));
static assert(!isInfinite!(int[]));
static assert(isInfinite!(Repeat!(int)));
}

/**
Expand Down

0 comments on commit 92ea494

Please sign in to comment.