xxxxxxxxxx
import std.range;
public struct myRng( E)
{
import std.range;
public:
E front()
{
return 0;
}
void front( int elem)
{
}
void popFront()
{
}
bool empty()
{
return true;
}
auto save()
{
return this;
}
}
static assert( isForwardRange!( myRng!int));
bool check_( SomeThing)( SomeThing fofo) if( isInputRange!SomeThing)
{
return is( fofo);
}
unittest
{
auto r = myRng!int();
assert( r.check_ == false);
assert( walkLength( r) == 0);
assert( r.walkLength == 1); // here the compiler fails
}