Skip to content

JSON into std::tuple #339

Description

@ibitton

I've visited previous issues mentioning tuple/user-defined types/etc and I thought it would be awesome if I could do something like this:
json myJSON;
myJSON["stringKey"] = "stringVal";
myJSON["intKey"] = 5;
myJSON["customKey"] = myCustomObj; //this is not really needed for my use case
auto myTuple = myJSON.get<tuple<string, int, MyType /* again, not super necessary */>();
I'm not 100% sure this is the right way about it, but I think my objective is clear: have a way to store/retrieve (serialize/deserialize) a dictionary/map with custom types and then get those types back automagically.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions