"in" everywhere

Steven Schveighoffer schveiguy at yahoo.com
Thu Oct 7 06:59:02 PDT 2010


On Thu, 07 Oct 2010 07:54:14 -0400, atommixz <atommixz at gmail.com> wrote:

> It would be nice if it were possible to use the "in" expression wherever
> possible. Now it is only implemented for associative. arrays. (Weird).
> Examples of how this could be used:
> - Find string in string
> - Search for a character in a string
> - Search for an item in the array, array of characters, array of strings,
> tuples, enum, structure
> - what else?

This has been suggested before.  The problem is that 'in' is generally  
considered to be a fast operation (< O(n)) so linear search is out.

-Steve


More information about the Digitalmars-d mailing list