You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is really more of a question than an issue. I hope this is not too much trouble as I continue to discover what this library can help us with.
I am thinking of reading big values from a json file. I am wondering how to go about customising the from_json to support such. For instance the extended values of __int128_ and __uint128_t supported on some compilers. Or even some of those from the boost multiprecision library such as cpp_int. Is it possible to implement a from_json for such types and how would one go about it if so?
thanks once more
The text was updated successfully, but these errors were encountered:
dubnde
changed the title
How do I go about customing from_json to support __int128_t/__uint128_t?
How do I go about customising from_json to support __int128_t/__uint128_t?
Oct 10, 2018
In theory you could specialize adl_serializer on the types you mention. However, if you want to fiddle with the internal way of serializing JSON Numbers, this is not currently possible I'm afraid.
There is an external_constructor in detail/conversions/to_json.hpp which deals with it, it is a friend of basic_json.
At the time of implementing to_json/from_json mechanism, I did not find a good way to provide such low-level support, and thought that I'd wait for a real use-case to start thinking about it :)
Okay. Thanks very much for the response. Your response at least clarifies I was not misreading the API.
I also think I may achieve what I need with implementing the sax parser API since it passes through the string representation of the number as a double if such a number cannot fit into int64_t or unit64_t i.e
This is really more of a question than an issue. I hope this is not too much trouble as I continue to discover what this library can help us with.
I am thinking of reading big values from a
json
file. I am wondering how to go about customising thefrom_json
to support such. For instance the extended values of__int128_
and__uint128_t
supported on some compilers. Or even some of those from the boost multiprecision library such ascpp_int
. Is it possible to implement afrom_json
for such types and how would one go about it if so?thanks once more
The text was updated successfully, but these errors were encountered: