On 07/10/2010 15:22, Steven Schveighoffer wrote: <snip>
The problem is with generic code. Generic code that accepts some type that defines the "in" operator. What can that generic code expect for performance when using "in"? As a general rule, generic programming must always assume the worst case, and if we have no rules for 'in', the worst case is linear. Which means generic code may not use 'in' when it would be a fast operation. Same thing with indexing. Try sorting a 'random access' range which uses a linear search on opIndex, and see what the performance is.
<snip>
Surely, what matters most for generic code is that in has consistent _semantics_, rather than the computational complexity?
Stewart.