Fix debugger visualizer for Ext=gsl::dynamic_extent#857
Conversation
VS 2019 doesn't seem to match -1 for size_t template parameter, as a result dynamic span/basic_string_span/basic_zstring_span show extent as `extent = 4294967295` (for 32-bit builds). This change updates details::extent_type to have static constexpr size_ parameter for non-dynamic span/basic_string_span/basic_zstring_span and simplifies/removes dynamic versions from GSL.natvis fixes microsoft#856
JordanMaples
left a comment
There was a problem hiding this comment.
The change looks good, I suggest wrapping the definition for size_ in a debug check since the template arg is used for all other operations.
.natvis works in release as well, are you sure that wrapping it in ifdef |
|
Maintainers' call: While you're correct that the natvis works for debugging code build with release, the natvis is ultimately a debugging tool. GCC and Clang users won't get any benefit from the additional Please add the |
Can you please explain what kind of cost this change would introduce? It's a static variable, not much different than using template's |
|
It's not only |
I wanted to mention that inline consts would be even better, but GSL is C++14. I just realized that they are implicitly inline :) |
|
@pps83 let's use the static const. @CaseyCarter thanks for jumping in and clearing that up. |
VS 2019 doesn't seem to match -1 for size_t template parameter, as a result dynamic span/basic_string_span/basic_zstring_span show extent as
extent = 4294967295(for 32-bit builds). This change updates details::extent_type to have static constexpr size_ parameter for non-dynamic span/basic_string_span/basic_zstring_span and simplifies/removes dynamic versions from GSL.natvisfixes #856