Remove std::ranges::view_interface visualizer.#4835
Merged
StephanTLavavej merged 2 commits intomicrosoft:mainfrom Aug 8, 2024
Merged
Remove std::ranges::view_interface visualizer.#4835StephanTLavavej merged 2 commits intomicrosoft:mainfrom
std::ranges::view_interface visualizer.#4835StephanTLavavej merged 2 commits intomicrosoft:mainfrom
Conversation
Member
|
Hmm, this does seem like an inherently not-useful/not-implementable visualizer. I think we should simply remove it, and then if someone identifies a scenario in which it can be usefully implemented, we can add a working version later. |
size() is optional method for ranges::view_interfacestd::ranges::view_interface visualizer.
StephanTLavavej
approved these changes
Jul 19, 2024
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for fixing this! We still need to triple-mirror this into VS so it'll take effect, but this gets us one step closer. 👀 🪄 😸 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4830
Actually I tested it and I think
std::ranges::view_interfacenatvis may be useless.My test code:
For
std::ranges::view_interfacewithoutsize()I usedistream_view.For
std::ranges::view_interfacewithsize()I usedVectorViewfrom https://en.cppreference.com/w/cpp/ranges/view_interfaceI also called
size(),front(),empty(),back(),data()because the compiler didn't generate these methods by default and Natvis showedunknown size.My results:

As I can see Natvis never calls methods. It works great only for memory variables and intrinsics.
iota_view example:
And because
std::ranges::view_interfaceis dependent from_Derived, we can't create an intrinsic for its size.Am I correct and we always will receive "???" or "This expression has side effects and will not be evaluate"?