here is some code for your amusement: struct Input { auto opSlice (size_t start, size_t end) { static struct InputSlice { @property bool empty () { return false; } @property char front () { return 0; } void popFront () {} InputSlice save () { return this; } } import std.range.primitives; static assert(isForwardRange!InputSlice); return InputSlice(); } }
fixing code like this tames `isForwardRange`: template isForwardRange(R) { enum bool isForwardRange = isInputRange!R && is(typeof( (inout int = 0) { R r1 = R.init; //old: static assert (is(typeof(r1.save) == R)); auto s1 = r1.save; static assert (is(typeof(s1) == R)); })); } i wonder if some other checking primitives has similar bug.
signature.asc
Description: PGP signature