-
-
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
Iterators cannot be used with range-v3 #3130
Comments
I did some digging here. The more easily resolved issues are that They can all be defaulted, except for the copy assignment operators. For Also, That makes it an The major problem with using it for This part works though:
You can't do it with |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I will have a look at this soon. I hope we can fix |
This makes the iterator const-dereferenceable, which is assumed for all iterators. For
This resolves some lifetime issues and means you don't have to store an extra empty string in each instance. If you are feeling really fancy, you can annotate it as
See https://clang.llvm.org/docs/AttributeReference.html#no-destroy The mutable data members are pretty weird, since it means your allegedly It's also a little strange that you cannot call |
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
Fixes nlohmann#3130. Related discussion: nlohmann#3408
* Add C++20 3-way comparison operator and fix broken comparisons Fixes #3207. Fixes #3409. * Fix iterators to meet (more) std::ranges requirements Fixes #3130. Related discussion: #3408 * Add note about CMake standard version selection to unit tests Document how CMake chooses which C++ standard version to use when building tests. * Update documentation * CI: add legacy discarded value comparison * Fix internal linkage errors when building a module
I just noticed that the things described in this issue are still not solved. I thought that it might already work, because the issue got already closed. However, I tried this only with |
What is the issue you have?
(Apologies if this should have been a discussion item and not a bug report.)
I have a JSON object and would like to extract the keys (preferably as a
set
). (In jsoncpp this is accomplished with.getMemberNames()
)Ideally this would work with range-v3, but the iterator of this library does not seem to be compatible:
json.items() | ranges::views::keys
ranges::subrange(json.begin(), json.end()) || ranges::views::keys
json.items() | ranges::views::transform([](auto&& _v) { return _v.key(); })
Please describe the steps to reproduce the issue.
As above ^^
Can you provide a small but working code example?
What is the expected behavior?
And what is the actual behavior instead?
Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: