Skip to content

How can I get a json out of a value_type? #4005

Closed Answered by nmkoremblum
nmkoremblum asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, this can be solved by doing:

int intVal{123456};
nlohmann::json::value_type intValT = intVal;
nlohmann::json intJson = intValT;
ASSERT_STREQ(to_string(intVal).data(), intJson.dump().data());

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nmkoremblum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant