Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kobets <dmitrykobets@microsoft.com>2022-06-21 19:46:28 +0300
committerDmitry Kobets <dmitrykobets@microsoft.com>2022-07-01 20:23:21 +0300
commit4c6f7b29236aed5cbb5f67fac954250d46394855 (patch)
tree6ccbe890bcd39dc38c5ec37f50eb81b19c82b26c
parentbe0a8a2caad9c83a9368d5e9e348a6566e60c5c4 (diff)
Mark dynamic_extent as inline, compiler-version-permittingdmitrykobets/gsl_const_inline
-rw-r--r--include/gsl/span_ext2
-rw-r--r--include/gsl/util6
2 files changed, 7 insertions, 1 deletions
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<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
{
//