GCs in the news

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 11:20:33 PDT 2014


On Thu, Jul 17, 2014 at 06:09:49PM +0000, deadalnix via Digitalmars-d wrote:
> On Thursday, 17 July 2014 at 18:08:18 UTC, Dicebot wrote:
> >On Thursday, 17 July 2014 at 17:58:15 UTC, Chris wrote:
> >>That's good news! See, we're getting there, just bear with us. This
> >>begs the question of course, how will this affect existing code? My
> >>code is string intensive.
> >
> >Usually GC-free API is added by providing new overloads that take an
> >output range instance as an argument so no existing code should break
> >(it will still use allocating versions)
> 
> Yes, output ranges are underused by now.

Actually, I've realized that output ranges are really only useful when
you want to store the final result. For data in mid-processing, you
really want to be exporting an input (or higher) range interface
instead, because functions that take output ranges are not composable.
And for storing final results, you just use std.algorithm.copy, so
there's really no need for many functions to take an output range at
all.


T

-- 
One Word to write them all, One Access to find them, One Excel to count them all, And thus to Windows bind them. -- Mike Champion


More information about the Digitalmars-d mailing list