-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
feature-#189 #190
feature-#189 #190
Conversation
Thanks a lot, you went above and beyond doing the unit tests, I'll just look into a couple possible changes, make an example, and this will be merged :) Thanks again for your work. |
I've looked further into the code and noticed the fact that you can't exactly do something like crow::json::wvalue value ({
{"x", 1},
{"y", "two"}
}); which to some extent makes it a comparison between crow::json::wvalue result;
result["userid"] = userid;
result["email"] = email;
result["firstname"] = firstname;
result["lastname"] = lastname;
return result; and crow::json::wvalue result, userid, email, firstname, lastname;
username = 5;
email = "[email protected]";
firstname = "first_name";
lastname = "last_name";
result = {
{"userid", userid},
{"email", email},
{"firstname", firstname},
{"lastname", lastname}
}; I've seen an example of a multi-type list here and here. Another way is to just have the constructor somehow parse whatever type into |
I'll had some exemples to enlighten and show when you can and can't use implicit conversions with those constructors and assignments. |
I actually resolved the "issue", there were no implicit constructor for each supported types in |
…ests. + json::wvalue::wvalue(std::initializer_list<std::pair<std::string const, json::wvalue>> + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue> const&) + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue>&&) + json::wvalue::operator=(std::initializer_list<std::pair<std::string const, json::wvalue>>) + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue> const&) + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue>&&)
+ added corresponding tests. + Added json-map examples.
Looks alright to me. I don't have as much experience as I would like though so @mrozigor do you see anything that might be problematic? |
Overall it looks like a good idea to me ;) I've added a couple of comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes done.
Thanks for your work @lcsdavid, I have to add this to the JSON Guide and make a couple changes here and there, but for now I'll merge it into master. Thanks again for doing a great job! |
feature-#189