diff options
author | dmitrykobets-msft <89153909+dmitrykobets-msft@users.noreply.github.com> | 2022-07-19 03:42:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 03:42:21 +0300 |
commit | 330583f47800c60cf001239550d291d16274756a (patch) | |
tree | 6ccbe890bcd39dc38c5ec37f50eb81b19c82b26c /include/gsl | |
parent | d9fc52e20e32fcc804502480a781120b210afd41 (diff) |
Resolve MSVC warning C5260 (#1049)
* Test solution
* Mark dynamic_extent as inline, compiler-version-permitting
Diffstat (limited to 'include/gsl')
-rw-r--r-- | include/gsl/span_ext | 2 | ||||
-rw-r--r-- | include/gsl/util | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/gsl/span_ext b/include/gsl/span_ext index d86f736..516cc99 100644 --- a/include/gsl/span_ext +++ b/include/gsl/span_ext @@ -41,7 +41,7 @@ namespace gsl {
// [span.views.constants], constants
-constexpr const std::size_t dynamic_extent = narrow_cast<std::size_t>(-1);
+GSL_INLINE constexpr const std::size_t dynamic_extent = narrow_cast<std::size_t>(-1);
template <class ElementType, std::size_t Extent = dynamic_extent>
class span;
diff --git a/include/gsl/util b/include/gsl/util index b6dbd18..aebfc66 100644 --- a/include/gsl/util +++ b/include/gsl/util @@ -45,6 +45,12 @@ #define GSL_NODISCARD #endif // defined(__cplusplus) && (__cplusplus >= 201703L) +#if defined(__cpp_inline_variables) +#define GSL_INLINE inline +#else +#define GSL_INLINE +#endif + namespace gsl { // |