On Monday, 17 April 2017 at 19:00:44 UTC, Jonathan M Davis wrote:

Because otherwise, it's not acting like a reference to the original range, which is the whole point of RefRange. The correct solution would probably be to @disable opAssign in the case where the original range can't be overwritten by another range.

This doesn't look quite right. References in D are rebindable. That is, assigning a reference to a reference does not copy referenced object, only the reference itself.
It seems that RefRange is trying to impersonate a C++ reference.

Reply via email to