Skip to content

Commit

Permalink
Mark dynamic_extent as inline, compiler-version-permitting
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrykobets-msft committed Jun 21, 2022
1 parent 10ee1b0 commit 48c07c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/gsl/span_ext
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions include/gsl/util
Expand Up @@ -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
{
//
Expand Down

0 comments on commit 48c07c9

Please sign in to comment.