std.container: SList linearRemove confusion

Johannes Pfau spam at example.com
Thu Oct 7 10:36:43 PDT 2010


On 07.10.2010 19:09, Steven Schveighoffer wrote:
> On Thu, 07 Oct 2010 12:44:48 -0400, Johannes Pfau <spam at example.com> wrote:
>> Is this really the expected behavior for linearRemove?
> 
> Yes, an SList range is terminated by a null pointer, so there is no
> limit to how far it will iterate.
> 
> Try to construct an SList range (without using Take) that doesn't
> iterate the rest of the list.

OK, that makes sense.
> 
> Yes, fix it in your local copy :)  It is a seldom used construct, so
> there should be no real compiled code in Phobos that will be affected. 
> Just change the source and everything will be good.

OK I've done that. works great now.
> But do also file a bug please.

Done: http://d.puremagic.com/issues/show_bug.cgi?id=5011
> -Steve

Thanks for your help!
-- 
Johannes Pfau


More information about the Digitalmars-d-learn mailing list