-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Indexing const basic_json<>
with const basic_string<char>
#157
Comments
OK it seems that fixing #135 caused this. Right now I have a lot of code that passes The "workaround" proposed in #135 is to use Basically what I need for my use case is:
I would have prefered if, instead of removing Sadly I didn't knew about #135 untill all my code just broke (nothing serious, I am just checking a previous version of the library now). Maybe next time such an API breaking change is being discussed the |
Hi @gnzlbg, sorry for the inconvenience. As there are no proper releases yet, I cannot really deprecate functionality, because everything in the master branch is basically just a development snapshot. I hope to have a "proper" 1.0 done soon and finally get some roadmap. Then, deprecating functions can be properly documented. As for #135, I though quite a while, but better similarity to STL was the reason to change the API. Once again, sorry for your troubles. |
No worries! I understand the motivation to do as the STL does and can live with an older version. If a method for unchecked |
If you are sure the key (let's say |
This is one of the things i'm doing in a loop (i is an index): ... j["files"][i]]["fields"][name]; Using at adds 4 unnecessary checks and looks like this (which is not that ... j.at("files").at(i).at("fields").at(name); Using find it looks like: ... *(*(*(*j.find("files")).find(i)).find("fields")).find(name); |
iterator also has operator-> |
That should work, thanks! |
I cannot index
const basic_json<>
with aconst basic_string<char>
anymore.The text was updated successfully, but these errors were encountered: