opIndex, opSlice, length for joiner?

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 20 10:37:47 PST 2016


On Wednesday, 20 January 2016 at 17:36:29 UTC, Maverick Chardet 
wrote:
> The most important issue that comes to my mind is that the 
> operations would not take constant time... A trivial 
> implementation would be in O(k) where k is the number of joined 
> ranges, and with some precomputation in O(k) time and space we 
> can make length O(1) and opIndex and opSlice O(log k)... Would 
> that be a problem?

I definitely think you should open a PR with your ideas 
regardless of what people say in this thread. Secondly, giving 
the user more options than he/she had before can't really be a 
bad thing, even if the options aren't perfect. That is, if you 
clearly document the trade-offs in the documentation.

But I am saying this before I see the code, so I can't really say 
one way or the other.


More information about the Digitalmars-d mailing list