Strange behavior of the function find() and remove()

Dennis Ritchie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 8 15:30:42 PDT 2015


On Sunday, 8 March 2015 at 21:58:20 UTC, safety0ff wrote:
> On Sunday, 8 March 2015 at 21:34:25 UTC, Dennis Ritchie wrote:
>> This is normal behavior?
>>
>
> Yes it is normal, there are two potential points of confusion:
> - remove mutates the input range and returns a shortened slice 
> to the range which excludes the removed element.
> - remove takes an index as its second argument, not an element.
>
> For more information see: 
> https://issues.dlang.org/show_bug.cgi?id=10959

Thanks.


More information about the Digitalmars-d-learn mailing list