Mark dynamic_extent as inline, compiler-version-permitting

This commit is contained in:
Dmitry Kobets 2022-06-21 09:46:28 -07:00
parent be0a8a2caa
commit 4c6f7b2923
2 changed files with 7 additions and 1 deletions

View File

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

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