-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Fix conversion to std::optional #4742
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
Conversation
…::optional) Signed-off-by: Niels Lohmann <[email protected]>
…::optional) Signed-off-by: Niels Lohmann <[email protected]>
…::optional) Signed-off-by: Niels Lohmann <[email protected]>
…::optional) Signed-off-by: Niels Lohmann <[email protected]>
…::optional) Signed-off-by: Niels Lohmann <[email protected]>
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.
OK with code modification and unit test.
Shouldn't the from_json() function for std:optional be inlined like other from_json() functions?
Signed-off-by: Niels Lohmann <[email protected]>
No, that's not necessary. This is a template function that is not a full specialization, so the |
Would you propose reverting this? |
It doesn't hurt, but it is redundant. You never know when they may add a clang tidy check for it. Since the PR hasn't been merged yet, it might be worth it. |
Signed-off-by: Niels Lohmann <[email protected]>
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.
OK with all modifications
This MR fixes the conversion from JSON to
std::optional
by making it independent ofJSON_USE_IMPLICIT_CONVERSIONS
.Fixes #4740