Skip to content

Commit

Permalink
Resolve MSVC warning C5260 (#1049)
Browse files Browse the repository at this point in the history
* Test solution

* Mark dynamic_extent as inline, compiler-version-permitting
  • Loading branch information
dmitrykobets-msft committed Jul 19, 2022
1 parent d9fc52e commit 330583f
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
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 330583f

Please sign in to comment.