> Nah, it's simpler than that: > > assert(is(typeof(b) == int[])); > > which is done by retro (it detects if you're retro-ing a retro range, and > just returns the original). > > -Steve
Makes sense. But still, I think inlining is responsible for the following code generating identical machine code: import std.range; import std.stdio; import std.algorithm; int id(int a){return a;} void main(){ int[] a=new int[1000]; auto b=retro(map!id(map!id(retro(a)))); writeln(b.front); } Correct me if I'm wrong, but I think phobos does only handle the special case retro(retro(x)) explicitly. -Timon