Is there any reason why in can't work with dynamic arrays?

Brett Brett at gmail.com
Tue Sep 17 17:43:39 UTC 2019


T[] x;

if (y in x) ...

It just checks to see if y is in between 0 and length. Clearly y 
has to be an int and clearly the semantics are equivalent to AA 
and so it all works out rather than having an arbitrary special 
case.

This is helpful when one has generate algorithms that can work 
with AA's or DA's that use in.



More information about the Digitalmars-d mailing list