-
-
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
No structured bindings support? #901
Comments
You need to use the |
Another thing that would prevent supporting deduction guides like this is that the iteration proxy is lazy. It doesn't compute the key and value unless you ask for them. It's the same reason that it doesn't have |
Would it be a good idea to add |
There would be a performance cost to that. It probably wouldn't be huge, but it would mean that incrementing the iterator either calls |
Summary: Currently: With |
Correction: Also, another point from a comment on #874
This means that assuming we do add
and get output like this:
I'm not sure whether that's a good thing or not. |
I have not looked into my |
It's what the map stores internally in its nodes. |
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. |
FYI: Structured binding support has recently been merged (#1391) and will be part of the next release. |
Bug Report
What is the issue you have?
Cannot use C++17 structured bindings for iteration
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Although this DOES work (taken from the docs):
The following DOES NOT work:
What is the expected behavior?
It should do the same thing as the traditional iterator implementation
And what is the actual behavior instead?
Does not compile
Which compiler and operating system are you using? Is it a supported compiler?
clang++ 6.0 (svn tree)
Did you use a released version of the library or the version from the
develop
branch?Yes, 3.0.1
If you experience a compilation error: can you compile and run the unit tests?
The tests work fine, so no issues there
Feature Request
Describe the feature in as much detail as possible.
Include sample usage where appropriate.
The text was updated successfully, but these errors were encountered: