From 4c6f7b29236aed5cbb5f67fac954250d46394855 Mon Sep 17 00:00:00 2001 From: Dmitry Kobets Date: Tue, 21 Jun 2022 09:46:28 -0700 Subject: [PATCH] Mark dynamic_extent as inline, compiler-version-permitting --- include/gsl/span_ext | 2 +- include/gsl/util | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/gsl/span_ext b/include/gsl/span_ext index 5f54e81..516cc99 100644 --- a/include/gsl/span_ext +++ b/include/gsl/span_ext @@ -41,7 +41,7 @@ namespace gsl { // [span.views.constants], constants -inline constexpr const std::size_t dynamic_extent = narrow_cast(-1); +GSL_INLINE constexpr const std::size_t dynamic_extent = narrow_cast(-1); template 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 { //