'in' for plain arrays?

Pelle Månsson pelle.mansson at gmail.com
Thu Dec 2 05:09:23 PST 2010


On 12/02/2010 01:07 PM, spir wrote:
> Hello,
>
> Is there an equivalent of 'in' for (non-associative) arrays? Cannot find any 'contains' function.
> (Wouldn't it be nice to have in work for all arrays? What is the reason why it only works with AAs?)
>
> Denis
> -- -- -- -- -- -- --
> vit esse estrany ☣
>
> spir.wikidot.com
>

It doesn't exist for performance reasons, I think.

Use std.algorithm.canFind, which doesn't have the best name, but works 
as expected.


More information about the Digitalmars-d-learn mailing list