how to store a range transformed by a range function?

2014-06-19 Thread Vlad Levenfeld via Digitalmars-d-learn
I've got an app that uses a custom range type over some preallocated arrays. These arrays are accessed through a getter fuction (supplied by the struct that is maintaining a unique reference to the array) that returns a T[]. Typical usage involves a source range, target range, and a graph of

Re: how to store a range transformed by a range function?

2014-06-19 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jun 19, 2014 at 08:02:39PM +, Vlad Levenfeld via Digitalmars-d-learn wrote: [...] For example, lets say I had a couple of managed arrays of doubles, and I had some computational path that, at some point, took these two ranges and zipped them before passing them along. At that node

Re: how to store a range transformed by a range function?

2014-06-19 Thread Vlad Levenfeld via Digitalmars-d-learn
Thank you. This would work, however I'm wary of a class-based solution. InputRangeObject.save() calls new and it appears opSlice is unimplemented for some technical reasons... I think perhaps, since my case is more specialized than the use cases InputRangeObject is meant for, wrapping some