-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Discuss: replace static "iterator_wrapper" function with "items" member function #874
Comments
I think adding the |
Any further comments? |
Oh, thanks for referencing this, it points out that I missed something in my evaluation on the deduction guides issue. |
Just one more: we don't necessarily need to remove I'd say add |
Instead of adding |
To follow semver, we need to deprecate it now and remove it in 4.0. |
Right, this is what I meant. |
|
A note in https://github.com/nlohmann/json/blob/develop/doc/examples/iterator_wrapper.cpp would be helpful. |
@Anthony-J-Garot I did so in be1eafa which should be merged to develop soon(ish). |
* 🔥 consolidate documentation * ♻️ overwork std specializations * 🚚 move images files to mkdocs * ♻️ fix URLs * 🔧 tweak MkDocs configuration * 🔧 add namespaces * 📝 document deprecations * 📝 document documentation generation * 🚸 improve search * 🚸 add examples * 🚧 start adding documentation for macros * 📝 add note for #874 (comment) * 📝 overwork example handling * 📝 fix Markdown tables
The static
iterator_wrapper
function is a means to access objects' keys in a range for. Example:I never was happy about the name of the function and there were several issues where users expected
json
to behave as a map so that.first
and.second
could be used.Question 1
As for the name: What about replacing the static
iterator_wrapper
function by a member functionitems
(name motivated by Python)?Usage:
Question 2
One could even think about supporting
.first
and.second
, but this would mean pre-computing the values for.key()
and.value()
which would mean a bit of overhead.What do you think?
The text was updated successfully, but these errors were encountered: