Using this line of code:
nlohmann::json msg_j = "{\"H\":\"1\",\"N\":3,\"D1\":3,\"D2\":150}"_json;
std::string s = msg_j.dump();
I get as a result s:
{"D1":3,"D2":150,"H":"1","N":3}
Which is not in the desired order:
{"H":"1","N":3,"D1":3,"D2":150}
Please tell me how to get it, so I can finally solve my request for this post.
As JSON library for C++, I use nlohmann::json
.