improving the join function

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 12 07:02:25 PDT 2010


On 10/12/2010 01:25 AM, Pelle wrote:
> I think the function signature should be more of isInputRange!R1 &&
> isInputRange(ElementType!R1), same with the is(). As the first one
> should be a range of ranges.

Correct. I figured out my mistake when I started playing with an 
implementation.

> I think this should be a lazy range of ElementType!(ElementType!R1), or
> perhaps the common type. No reason to be overly eager :-)

That's already present, see std.algorithm.joiner(). The problem with 
joiner() is that it's rather slow - there are a few tests for each 
element iterated. An eager join() is still necessary.


Andrei


More information about the Digitalmars-d mailing list