digitalmars.D.learn - Lazily Partially Sorted
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (9/9) Feb 15 2015 I would like to implement a variant of Sorted at
I would like to implement a variant of Sorted at https://github.com/D-Programming-Language/phobos/pull/2793 that does completeSort of _store lazily instead of eagerly. I guess this is a bit more complex to implement as all accessors of LazySorted, such as opIndex, opSlice, etc (to the underlying storage) needs to be wrapped by a logic that checks whether the underlying storage (_store) is dirty (this.dirtyIndex > this._store.length) and if so sorts it. Is there some clever D way to implement this?
Feb 15 2015