"Andrei Alexandrescu" <seewebsiteforem...@erdani.org> wrote in message news:gv2hj8$k1...@digitalmars.com... > dsimcha wrote: > > Consider: > > struct R > { > bool empty(); > ref int front(); > void popFront(); > } > > ref int popNext(ref R fwdRange) > { > auto result = & fwdRange.front(); > fwdRange.popFront; > return *result; > } > > void main() > { > R r; > int x = r.popNext; > } > > This should work, I just noticed with surprise it doesn't. It's a bug, > specifically bug 3015: > > http://d.puremagic.com/issues/show_bug.cgi?id=3015 >
I thought that was only supposed to work for arrays. Has that changed? If so, what's the new rule?