Deserializing a JSON-array to a range is risky due to having to be careful with ownership of the underlying text-iopipe, but useful to save on allocations.
So until the range is fully consumed, client code wouldn't be allowed to advance the JsonTokenizer. Maybe an implementation could be clever and detect this and throw in that case, maybe only in debug mode.
Another source of problems will be that ranges are mostly value-types in D. foreach will implicitly create a copy of the range it iterates over, so care has to be taken to not store the full JsonTokenizer object but only a handle to it.
cc @benjones
Deserializing a JSON-array to a range is risky due to having to be careful with ownership of the underlying text-iopipe, but useful to save on allocations.
So until the range is fully consumed, client code wouldn't be allowed to advance the JsonTokenizer. Maybe an implementation could be clever and detect this and throw in that case, maybe only in debug mode.
Another source of problems will be that ranges are mostly value-types in D.
foreachwill implicitly create a copy of the range it iterates over, so care has to be taken to not store the full JsonTokenizer object but only a handle to it.cc @benjones