The <span> header not only contains the std::span type, but also the std::dynamic_extent constant. This constant is present and accessible as nonstd::dynamic_extent when using the span-lite implementation, but disappears from the namespace if the std::span implementation is selected.
To avoid this, it would be great to import std::dynamic_extent into the nonstd namespace if using std::span, i.e.
#if span_USES_STD_SPAN
#include <span>
namespace nonstd {
using std::span;
using std::dynamic_extent; // Add this
The
<span>
header not only contains thestd::span
type, but also thestd::dynamic_extent
constant. This constant is present and accessible asnonstd::dynamic_extent
when using the span-lite implementation, but disappears from the namespace if thestd::span
implementation is selected.To avoid this, it would be great to import
std::dynamic_extent
into thenonstd
namespace if usingstd::span
, i.e.