-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Why XMLDocument::SaveFile is not const like in TinyXML 1 ? #523
Comments
That's a minor bug. The issue is that SaveFile() can cause a SetError() to occur. Possibly SetError() should be mutable - but that's clunky - or the save shouldn't set an error? |
Making SetError (and the errors attributes) mutable is a quick and easy solution. However, this isn't clean. Maybe XMLDocument shouln't store errors but functions currently using SetError should return a kind of Error object (as you don't want TinyXML2 to use exceptions). |
Same question on XMLDocument::DeepCopy. I think it can be const. |
Why is it not clean to declare the error value mutable? It sounds like the correct solution to achieve const-correctness. |
Just wonder why, as my program relies on this and I would prefer not to change it as a save operation is not supposed to change the XMLDocument object.
The text was updated successfully, but these errors were encountered: