-
Notifications
You must be signed in to change notification settings - Fork 67
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
By not existing keys returns 0 #32
Comments
And one more additional question to using of |
Hi @SerTetora, thanks for using inifile-cpp and thanks for your elaborate explanation! So if I understand you correctly either the section or the key of a section that you try to access does not exist in the inifile, correct? It makes sense that a non-existing value actually returns If you want to check if a section or key exists you can use I agree that the behaviour when converting to a int or bool is unexpected. What would your expected behaviour be? Throwing an exception? An assertion (for safe debug and fast release builds)? |
Actually
Since any past iterator remains valid, I guess the memory might not be cleared (from clear) |
Correct.
Thank you for the clarification and suggestion. With
In my application, there are cases in runtime when values in
I really appreciate your explanation. It helped me a lot! |
Hi, @Rookfighter. thank you for a great tool.
I'm trying to read an example.ini. And if the group-key-pair not exist in the ini-file, it returns
""
that by converting toint
gives0
and by converting tobool
givesfalse
. It is in my opinion an unexpected behavior.example.ini
main.cpp
Output:
My workaround for now is
The text was updated successfully, but these errors were encountered: