Resolve MSVC warning C5260 (#1049)

* Test solution

* Mark dynamic_extent as inline, compiler-version-permitting
This commit is contained in:
dmitrykobets-msft 2022-07-18 17:42:21 -07:00 committed by GitHub
parent d9fc52e20e
commit 330583f478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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
{
//