On Wednesday, 16 April 2014 at 17:20:52 UTC, Adam D. Ruppe wrote:
OK, you could also store a pointer to the InputRange as your member.

With structs, assignment is making a private copy, so if you want to update the original in a stored thing you'll need the pointer. ref doesn't work with anything other than function arguments in D.

Yeah, I've started to realize that. The thing is, I have an almost identical range in a another module and it does exactly what I want it to do, i.e. the InputRange is passed by reference with ref and all changes become visible as soon as they happen.

Anyway, I'll try a pointer solution and see what happens. For efficiency's sake I don't want to copy anything.

Reply via email to