-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Json::Exception broken #216
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
Comments
…Resolves the most serious part of issue open-source-parsers#216)
A patch for the most serious problem (The reference member) has been pushed as fix candidate. |
from "reference to string" to "string" (Resolves the most serious part of issue #216)
Ugh! On Linux, I would run valgrind always. On the Mac, I have to be perfect, which I am not. I need to find a practical memory-checker. Anyway, I pulled that commit. We still want I don't have time right now to look at the other issues. But maybe you can research when |
The new exception class
Json::Exception
contains a data member of reference type. That means the initializing object is required to have a longer life-time than the exception class. But this does not happen: The class is always constructed by temporaries, so there are nasal daemons all around!I do not understand the reason to why a member reference has been chosen, but that is clearly wrong here. I suggest to replace the reference member by a normal non-reference member of type
std::string
that copies the provided argument.That being said: Why does the public header value.h declare the internal exception types and the corresponding factory functions? It would seem better (regarding implementation encapsulation) to move these declarations instead into an internal header (part of src, not part of include).
The text was updated successfully, but these errors were encountered: