multiple-item traversal ranges

spir denis.spir at gmail.com
Wed Mar 30 11:48:26 PDT 2011


On 03/30/2011 08:22 PM, dsimcha wrote:
>> And
>> opApply doesn't allow playing with other parts of "new style D" (esp algorithms).
>
> IMHO it should where possible, but a few bugs in opApply prevent me from fixing
> this.  Phobos should recognize "Iterables", or any type that can be iterated with
> a single-argument foreach.  Input ranges are a subtype of iterables.  Eventually
> std.algorithm should treat iterables as a supertype of ranges and things like map
> and filter should work.

Exactly, and the opSlice() trick recently evoked in a // thread, when works, 
provides for a first aspect of unification of collections & ranges. Remains to 
define a kind of super-super-type (iterable) for algorithms. Replace everywhere 
the isInputRange constraint by isIterable.

denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list