Skip to content

Conversation

@cdunn2001
Copy link
Contributor

See #423 and #424.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. Why is template<Integer,Float> above a namespace?

@cdunn2001
Copy link
Contributor Author

Oops. Updated.

@cdunn2001
Copy link
Contributor Author

Any comments?

Basically, we would name the template something obvious, then typedef Json::Value<std::string, int, double> to it. Users would have to change a few number-conversion function calls, but that would probably improve their code.

If anyone wants their own datatypes, they must provide toJson() and fromJson() converter specializations. We would need to settle on their signatures. toJson() is the hardest because it involves memory allocation.

@okodron
Copy link
Contributor

okodron commented Mar 3, 2018

Is it still relevant?

@cdunn2001
Copy link
Contributor Author

It's future planning. In my opinion, this is closer to how jsoncpp parsers should look. The user should choose both the internal datatypes and how they are converted to/from JSON data. (We could provide useful defaults.) Not only is that flexible, but it also would eliminate a large fraction of bug reports (here and elsewhere).

@baylesj baylesj closed this Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants