Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preseving order of items in json #262

Closed
moneroexamples opened this issue Jun 7, 2016 · 2 comments
Closed

Preseving order of items in json #262

moneroexamples opened this issue Jun 7, 2016 · 2 comments

Comments

@moneroexamples
Copy link

Is there a way of cunstring json object so that it preserves the ordering of elements?

For example, this:

    nlohmann::json j1 {{"ccc", 2}, {"aaa", 4}};
    cout << j1 << endl;

results in a string in different order than originally defined

{"aaa":4,"ccc":2}

I would like to preserve the orginal order, i.e., to get this instead:

{"ccc":2,"aaa":4}
@gregmarr
Copy link
Contributor

gregmarr commented Jun 7, 2016

See this issue #106

@moneroexamples
Copy link
Author

Thanks, so it seems as there is no "easy" way for this.

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

No branches or pull requests

3 participants