Skip to content

isConvertibleTo doesn't support uint64 #608

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

Closed
stonewesley opened this issue Apr 25, 2017 · 1 comment
Closed

isConvertibleTo doesn't support uint64 #608

stonewesley opened this issue Apr 25, 2017 · 1 comment

Comments

@stonewesley
Copy link

I'm trying to test if an uint64 isConvertibleTo Json::uintValue, since there is no uint64Value.
While actually, it failed to convert. I look through, and find the code maybe lack of something in function isConvertibleTo when the case is uintValue.
It only use isUInt() but not isUInt64(). And in function isUInt(), it compares value_ to maxUInt which is the max value of uint32, so it failed.
I don't know if there is another way to test an uint64 value.
Hope this may help.

@cdunn2001
Copy link
Contributor

See #509, maybe.

My own preference would be to read/write JSON as strings, and to let type-conversion be a separate step. That's a little slower, but sooooooo much easier to code (and to test/debug). I think most Json libraries do this wrong. An implementation of the type-converter could then be templated on integer, float, string, array, and map. But that would be a new library.

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

No branches or pull requests

2 participants