Ruling out arbitrary cost copy construction?

Jonathan M Davis jmdavisProg at gmx.com
Wed Oct 6 23:39:21 PDT 2010


On Wednesday 06 October 2010 23:09:04 Andrei Alexandrescu wrote:
> I agree with all of the above. After all has been said and done, it
> looks like uniform function call syntax is a pivotal feature for
> simplifying ranges. Most ranges can simply define the basic operations,
> and std.range takes care of defining boilerplate defaults for a host of
> cases. For example, you just call r.moveFront() and that becomes
> moveFront(r) which is defined by std.range.
> 
> Whenever the range is defined in a way that makes it impossible to
> generate e.g. moveFront() appropriately, the user would have to. Would
> this be acceptable?

It certainly sounds good to me. The only downside is that anyone writing 
algorithms that use ranges still has to worry about using, moveFront(), but for 
the most part, not using it just means that their algorithm is less efficient in 
the same way that it wolud be if moveFront() didn't exist, so you don't really 
lose anything. I do think that we need to avoid complicating ranges any further, 
however.

- Jonathan M Davis


More information about the Digitalmars-d mailing list