Added support for long in json#189
Conversation
|
... and long long too? |
|
Hi @notorand-it, long long was already supported. In fact the currently supported types are (long long, int and double). I don't see why we are only restricting those types. When using the Wt::Json::Value class I expect to be able to give any primitive type and that the class should implicitly convert it to a number. So, I do agree with you, I think that we should support unsigned numbers and signed numbers less than 4 bytes (short & int8_t). Do you think there is a reason not to support them ? |
There was a problem hiding this comment.
Thanks for your contribution. I have some minor remarks before I can merge it.
As for why the JSON library may lack certain features: the Wt JSON library was created more out of necessity than as a feature of Wt. Wt::Auth's OAuth support needed to use JSON, so we added a JSON library back in 2011. We didn't have the wealth of JSON libraries that we have now, like JSON for Modern C++, Boost.JSON, or RapidJSON.
Regards,
Roel
|
Thanks. I like your profile picture 🙂 Regards, |
I don't see why JSON does not support long values.
I added a constructor that supports long values and the associated code.