Skip to content

utility: Deserialize (an array) to a range #35

Description

@Inkrementator

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions