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 due to the implicit conversions/constructors in the library. If you disable them, then this code no longer compiles. See here for how to disable them: https://github.com/nlohmann/json#implicit-conversions
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stalebot
added
the
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
label
Jan 9, 2022
so this issue can be closed, right? works as designed?
stalebot
removed
the
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
label
Jan 14, 2022
Specifically
std::shared_ptr<nlohmann::json>() == nlohmann::json()
compiles (where one forgot to deference the shared_ptr before comparing).What is the issue you have?
It is easy to miss dereferencing the pointer and so have the comparison not be as desired.
Please describe the steps to reproduce the issue.
std::shared_ptr<nlohmann::json>() == nlohmann::json()
Can you provide a small but working code example?
std::shared_ptr<nlohmann::json>() == nlohmann::json()
(which is true) orstd::make_shared<nlohmann::json>() == nlohmann::json()
(which is false)What is the expected behavior?
A compilation error would be really nice as it is very likely a bug.
And what is the actual behavior instead?
Compiles (as far as I know, the comparison result is what you would expect given that it compiles.
Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: