-
-
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
Getting member discarding qualifyer #159
Comments
You may want to have a look at the discussions in #133. |
This doesn't suit me at all. From what I gather from I'm using the json objects to be the storage of event I also thought that because of the use of modern C++, var foo = 1;
console.log(foo['a']);
// null
foo = ['a', 'b'];
console.log(foo['0']);
// 'a'
foo = {'a':1};
console.log(foo['b']);
// null This is probably the best json lib there is, but I I really didn't want to do this, but so my code is |
It was a good idea to implement a const version of operator[] it in the first place. I was a pity that this implementation was flawed. It was a mistake to remove the const version completely. This commit re-introduces the const version. My apologies for all the inconvenience.
Hi @EvilPudding, just to let you know, I reintroduced the const operator[], see http://nlohmann.github.io/json/classnlohmann_1_1basic__json_a8e34088252a3ee6b2377f3a1f26dd1ba.html#a8e34088252a3ee6b2377f3a1f26dd1ba. Sorry for all the inconvenience. For the implicit conversions (e.g., returning |
Your response and modification was quick and The part about the implicit conversions was just a Thank you so much! |
I know there has been a lot of discussion on this topic in
the issues, but I don't know what conclusion you guys
arrived to, all I know is that I'm need to use json as a
const reference, and what I've been doing to access the
object entries isn't very efficient, what I want to do is:
But I get a warning that this discards the const qualifier,
so what I'm doing to fix it is the horrible:
Which works, but is silly and not efficient as hell, seen
this function is supposed to be called maybe thousands
of times per second. Is there a plan to fix it, and what
should I do meanwhile so that I'm not copying the
memory every time I call the function?
The text was updated successfully, but these errors were encountered: