diff options
author | Pavel P <pavlov.pavel@gmail.com> | 2020-03-27 10:14:23 +0300 |
---|---|---|
committer | Pavel P <pavlov.pavel@gmail.com> | 2020-03-27 22:59:04 +0300 |
commit | 830b081de7136c9ed7da1b08067680fcb2303f4a (patch) | |
tree | 0b700d6af298bbc174dc314179d46b79f1f5b70d /include | |
parent | 226a854a97087bbd9aa5ec2ccf94902b66037a72 (diff) |
Fix debugger visualizer for Ext=gsl::dynamic_extent
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 #856
Diffstat (limited to 'include')
-rw-r--r-- | include/gsl/span | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gsl/span b/include/gsl/span index 23c58c9..82fe58b 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -355,6 +355,13 @@ namespace details constexpr extent_type(size_type size) { Expects(size == Ext); } constexpr size_type size() const noexcept { return Ext; } + + private: +#if defined(GSL_USE_STATIC_CONSTEXPR_WORKAROUND) + static constexpr const size_type size_ = Ext; // static size equal to Ext +#else + static constexpr size_type size_ = Ext; // static size equal to Ext +#endif }; template <> |