More uses of operator "in"

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 28 12:45:38 PDT 2014


On Tuesday, 28 October 2014 at 14:06:27 UTC, Steven Schveighoffer 
wrote:
> On 10/28/14 9:50 AM, "Nordlöw" wrote:
>> Has there been any proposals/plans to make operator "in" work 
>> for
>> elements in ranges such as
>>
>>     assert('x' in ['x']);

…

> Your assertion requires O(n) performance.

It is O(ln(n)) on a sorted array.


More information about the Digitalmars-d-learn mailing list