This code displays an error: -------------- main.d ---------------------- import std.range; pragma(msg, ElementType!(void[])); ------------------------------------ dmd -c main void std\array.d(357): Error: [i] has no effect in expression (a[0u]) I think that this error message should be removed. If there is not an objection, I rewrite ElementType template as this: ------------------------------------ template ElementType(R) { static if (is(typeof({return R.init.front();}()) T)) alias T ElementType; else alias void ElementType; } ------------------------------------
Fixed. See also: http://www.dsource.org/projects/phobos/changeset/1809