-
-
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
Question about get_ref() #128
Comments
After a getter for a value and a pointer I did not follow to implement |
I'll try to provide a PR including tests and docs. One question: what would be the preferred form? To me get_ref is enough to convey that we get a reference, the |
I have this ready in my branch get_ref. |
Hi @dariomt, sorry for not answering earlier. As for your first question: I would prefer For your second question, I unfortunately have no answer. |
Any news here? |
My changes already implemented However, I'm still trying to get the branch in proper shape to make the PR easy for you, git newbie here :) |
Ok - looking forward to it! |
@dariomt - any news on this? |
Sorry, I haven't had time to look into this. |
PR ready! |
Thanks @dariomt for the good job! |
I see there were some discussions about adding get_ref(), but I can't see it in the code.
What happened to get_ref()?
I believe that having get_ref() is convenient and safe. It could merely call get_ptr() and throw if it returns nullptr. It makes it easier to traverse a json object when I'm pretty sure about the types it holds. Otherwise I have to constantly check against nullptr myself.
I'd like the following code to work seamlessly:
Currently I'd have to write the following:
Would you accept a PR for this functionality?
The text was updated successfully, but these errors were encountered: