So how exactly does one make a persistent range object?

Jonathan M Davis jmdavisProg at gmx.com
Sun Jun 5 16:30:09 PDT 2011


On 2011-06-05 09:43, Andrej Mitrovic wrote:
> Ah the good old typeof. It's nice to have language sugar like this
> that save the day. :)

I really don't think that Andrei was thinking that people would need to save 
ranges when he started internalizing all of the range types in std.range and 
std.algorithm. So, it _is_ a bit annoying for this particular use case. But 
for everything else, it's a definite improvement. There are fewer names in the 
namespace and it completely hides the type, highlighting that no one should 
care about what the return type really is (which is one of the things that 
seems to definitely scare newbie to std.algorithm - thank goodness for auto). 
So, as long as it's possible to still save ranges with typeof and whatnot, I'd 
expect that Andrei is going to want to make it so that _all_ functions which 
have their own range type just for returning have that type be internal to the 
function and effectively nameless.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list