Suggestion: Operator `in` for slices

Biotronic simen.kjaras at gmail.com
Mon Dec 20 07:55:40 UTC 2021


On Saturday, 18 December 2021 at 18:47:33 UTC, Adam Ruppe wrote:
> I'm not sure the speed rule is written or not, but generally 
> `in` is supposed to have the same speed requirement as `[n]` 
> which is sub-linear.

It's in 
[std.container](https://dlang.org/phobos/std_container.html), 
bottom of the page.

I [remember a discussion on 
complexity](https://forum.dlang.org/post/n3qtgq$2frv$1@digitalmars.com) that prompted Andrei to create a library for marking functions with their complexity. I'm not sure if this was the original source for the complexities given in std.container.

My brain is also telling me the values were sourced from 
Alexander Stepanov's [Elements of 
Programming](http://elementsofprogramming.com/), but I can't find 
a source for that, and I'm too lazy to look very deep.

--
   Biotronic


More information about the Digitalmars-d mailing list