On 11-Jun-2015 15:22, Steven Schveighoffer wrote:
On 6/11/15 4:24 AM, Dmitry Olshansky wrote:
Already works. Just define opSlice for container that returns a range
and then:
foreach(elem; container) {}
is lowered to:
foreach(elem; container[]) {}
I think you want to do opIndex which takes no parameters.
Ehm. How is being more logical or what is the reason?
opSlice is no
longer supposed to be used that way (though it still works for backwards
compatibility).
-Steve
Now that's the real news. Me thinks slice it on foreach was added
speicfically for std.container back in 2012. Where the docs for the
later change (well, both of them for that matter)?
--
Dmitry Olshansky