Following code should compile, but doesn't. import std.range; struct R { @disable this(); // requires explicit initializer @property bool empty() const{ return false; } @property int front(){ return 0; } void popFront(){} @property R save(){ return this; } int back(){ return 0; } void popBack(){} int opIndex(size_t n){ return 0; } @property size_t length() const { return 0; } } static assert(isInputRange!R); static assert(isForwardRange!R); static assert(isBidirectionalRange!R); static assert(isRandomAccessRange!R);
https://github.com/D-Programming-Language/phobos/pull/324
https://github.com/D-Programming-Language/phobos/commit/bd5141b027b5acddde0cf8596a2d223b47e1f8d3
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6f43a92cd2ed4b16e2dbf8cc6550396f82180b99 Fix predicate template implementations in std.traits and std.range Use T.init property instead of void initializer, because it will work even if T is const or immutable type. I must change a part of unit test for the bug 6935, because we cannot support ranges which overrides init property.