Use case: eliminate hidden allocations in buildPath

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Dec 5 11:23:39 PST 2013


05-Dec-2013 20:46, Andrei Alexandrescu пишет:
> On 12/5/13 8:19 AM, monarch_dodra wrote:
>> On Thursday, 5 December 2013 at 15:00:07 UTC, Andrei Alexandrescu wrote:
>>> Andrei
>>
>> Output range! :)
>>
>> Output range interface makes no linearity requirements. Just that:
>> "out.put(this)" compiles.
>
> Hrm, construction of a hash table is linearizable so bad example on my
> part. But I'm talking about general structured data such as objects with
> allocated fields and connections to other objects etc. etc.

Pass desired container type that follows some implicit protocol such as 
isGraph!T. Then container type defines allocation scheme (=some 
container specific default).

As an extended version allow passing reference to an allocator to use 
with that container type.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list