span: switch to std

There are no longer any external users in the openbmc org which are
not compiled with C++20 and using std::span directly.  Migrate all
internal code to use std::span, delete the typedefs, and remove the old
span-lite dependency.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I86bc9c0688c3828f9fe2ce006b273a55fc5fded9
diff --git a/src/meson.build b/src/meson.build
index c471f1b..9b4ad23 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -15,27 +15,8 @@
   fmt_dep = fmt_proj.dependency('fmt')
 endif
 
-# span-lite might not have a pkg-config. It is header only so just make
-# sure we can access the needed symbols from the header.
-span_dep = dependency('span-lite', required: false)
-has_span = meson.get_compiler('cpp').has_header_symbol(
-  'nonstd/span.hpp',
-  'nonstd::span<int>',
-  dependencies: span_dep,
-  required: false)
-if not has_span
-  span_lite_proj = import('cmake').subproject(
-    'span-lite',
-    required: false)
-  if span_lite_proj.found()
-    span_dep = span_lite_proj.dependency('span-lite')
-    has_span = true
-  endif
-endif
-
 stdplus_deps = [
   fmt_dep,
-  span_dep,
 ]
 
 stdplus_srcs = [
@@ -68,7 +49,7 @@
 endif
 
 has_fd = false
-if not get_option('fd').disabled() and has_span
+if not get_option('fd').disabled()
   has_fd = true
 
   stdplus_srcs += [
@@ -145,7 +126,6 @@
   'stdplus/flags.hpp',
   'stdplus/raw.hpp',
   'stdplus/signal.hpp',
-  'stdplus/types.hpp',
   subdir: 'stdplus')
 
 install_headers(
diff --git a/src/stdplus/fd/gmock.hpp b/src/stdplus/fd/gmock.hpp
index 37dc3eb..97a4f01 100644
--- a/src/stdplus/fd/gmock.hpp
+++ b/src/stdplus/fd/gmock.hpp
@@ -10,21 +10,23 @@
 class FdMock : public Fd
 {
   public:
-    MOCK_METHOD(span<std::byte>, read, (span<std::byte> buf), (override));
-    MOCK_METHOD(span<std::byte>, recv, (span<std::byte> buf, RecvFlags flags),
+    MOCK_METHOD(std::span<std::byte>, read, (std::span<std::byte> buf),
                 (override));
-    MOCK_METHOD(span<const std::byte>, write, (span<const std::byte> data),
-                (override));
-    MOCK_METHOD(span<const std::byte>, send,
-                (span<const std::byte> data, SendFlags flags), (override));
+    MOCK_METHOD(std::span<std::byte>, recv,
+                (std::span<std::byte> buf, RecvFlags flags), (override));
+    MOCK_METHOD(std::span<const std::byte>, write,
+                (std::span<const std::byte> data), (override));
+    MOCK_METHOD(std::span<const std::byte>, send,
+                (std::span<const std::byte> data, SendFlags flags), (override));
     MOCK_METHOD(size_t, lseek, (off_t offset, Whence whence), (override));
     MOCK_METHOD(void, truncate, (off_t size), (override));
-    MOCK_METHOD(void, bind, (span<const std::byte> sockaddr), (override));
+    MOCK_METHOD(void, bind, (std::span<const std::byte> sockaddr), (override));
     MOCK_METHOD(void, listen, (int backlog), (override));
-    MOCK_METHOD((std::tuple<std::optional<int>, span<std::byte>>), accept,
-                (span<std::byte> sockaddr), (override));
+    MOCK_METHOD((std::tuple<std::optional<int>, std::span<std::byte>>), accept,
+                (std::span<std::byte> sockaddr), (override));
     MOCK_METHOD(void, setsockopt,
-                (SockLevel level, SockOpt optname, span<const std::byte> opt),
+                (SockLevel level, SockOpt optname,
+                 std::span<const std::byte> opt),
                 (override));
     MOCK_METHOD(int, ioctl, (unsigned long id, void* data), (override));
     MOCK_METHOD(int, constIoctl, (unsigned long id, void* data),
diff --git a/src/stdplus/fd/impl.cpp b/src/stdplus/fd/impl.cpp
index 4335cf5..2d92b72 100644
--- a/src/stdplus/fd/impl.cpp
+++ b/src/stdplus/fd/impl.cpp
@@ -15,7 +15,7 @@
 
 using namespace std::literals::string_view_literals;
 
-span<std::byte> FdImpl::read(span<std::byte> buf)
+std::span<std::byte> FdImpl::read(std::span<std::byte> buf)
 {
     ssize_t amt = ::read(get(), buf.data(), buf.size());
     if (amt == -1)
@@ -33,7 +33,7 @@
     return buf.subspan(0, amt);
 }
 
-span<std::byte> FdImpl::recv(span<std::byte> buf, RecvFlags flags)
+std::span<std::byte> FdImpl::recv(std::span<std::byte> buf, RecvFlags flags)
 {
     ssize_t amt =
         ::recv(get(), buf.data(), buf.size(), static_cast<int>(flags));
@@ -52,7 +52,7 @@
     return buf.subspan(0, amt);
 }
 
-span<const std::byte> FdImpl::write(span<const std::byte> data)
+std::span<const std::byte> FdImpl::write(std::span<const std::byte> data)
 {
     ssize_t amt = ::write(get(), data.data(), data.size());
     if (amt == -1)
@@ -66,7 +66,8 @@
     return data.subspan(0, amt);
 }
 
-span<const std::byte> FdImpl::send(span<const std::byte> data, SendFlags flags)
+std::span<const std::byte> FdImpl::send(std::span<const std::byte> data,
+                                        SendFlags flags)
 {
     ssize_t amt =
         ::send(get(), data.data(), data.size(), static_cast<int>(flags));
@@ -107,7 +108,7 @@
     CHECK_ERRNO(::ftruncate(get(), size), fmt::format("ftruncate {}B", size));
 }
 
-void FdImpl::bind(span<const std::byte> sockaddr)
+void FdImpl::bind(std::span<const std::byte> sockaddr)
 {
     CHECK_ERRNO(
         ::bind(get(), reinterpret_cast<const struct sockaddr*>(sockaddr.data()),
@@ -120,8 +121,8 @@
     CHECK_ERRNO(::listen(get(), backlog), "listen");
 }
 
-std::tuple<std::optional<int>, span<std::byte>>
-    FdImpl::accept(span<std::byte> sockaddr)
+std::tuple<std::optional<int>, std::span<std::byte>>
+    FdImpl::accept(std::span<std::byte> sockaddr)
 {
     socklen_t len = sockaddr.size();
     auto fd = ::accept(
@@ -138,7 +139,7 @@
 }
 
 void FdImpl::setsockopt(SockLevel level, SockOpt optname,
-                        span<const std::byte> opt)
+                        std::span<const std::byte> opt)
 {
     CHECK_ERRNO(::setsockopt(get(), static_cast<int>(level),
                              static_cast<int>(optname), opt.data(), opt.size()),
diff --git a/src/stdplus/fd/impl.hpp b/src/stdplus/fd/impl.hpp
index 0487aba..b4e134c 100644
--- a/src/stdplus/fd/impl.hpp
+++ b/src/stdplus/fd/impl.hpp
@@ -11,19 +11,20 @@
   public:
     virtual int get() const = 0;
 
-    span<std::byte> read(span<std::byte> buf) override;
-    span<std::byte> recv(span<std::byte> buf, RecvFlags flags) override;
-    span<const std::byte> write(span<const std::byte> data) override;
-    span<const std::byte> send(span<const std::byte> data,
-                               SendFlags flags) override;
+    std::span<std::byte> read(std::span<std::byte> buf) override;
+    std::span<std::byte> recv(std::span<std::byte> buf,
+                              RecvFlags flags) override;
+    std::span<const std::byte> write(std::span<const std::byte> data) override;
+    std::span<const std::byte> send(std::span<const std::byte> data,
+                                    SendFlags flags) override;
     size_t lseek(off_t offset, Whence whence) override;
     void truncate(off_t size) override;
-    void bind(span<const std::byte> sockaddr) override;
+    void bind(std::span<const std::byte> sockaddr) override;
     void listen(int backlog) override;
-    std::tuple<std::optional<int>, span<std::byte>>
-        accept(span<std::byte> sockaddr) override;
+    std::tuple<std::optional<int>, std::span<std::byte>>
+        accept(std::span<std::byte> sockaddr) override;
     void setsockopt(SockLevel level, SockOpt optname,
-                    span<const std::byte> opt) override;
+                    std::span<const std::byte> opt) override;
     int ioctl(unsigned long id, void* data) override;
     int constIoctl(unsigned long id, void* data) const override;
     void fcntlSetfd(FdFlags flags) override;
diff --git a/src/stdplus/fd/intf.hpp b/src/stdplus/fd/intf.hpp
index bd8de13..7778ae1 100644
--- a/src/stdplus/fd/intf.hpp
+++ b/src/stdplus/fd/intf.hpp
@@ -2,8 +2,8 @@
 #include <cstddef>
 #include <fcntl.h>
 #include <optional>
+#include <span>
 #include <stdplus/flags.hpp>
-#include <stdplus/types.hpp>
 #include <sys/socket.h>
 #include <tuple>
 
@@ -85,19 +85,21 @@
   public:
     virtual ~Fd() = default;
 
-    virtual span<std::byte> read(span<std::byte> buf) = 0;
-    virtual span<std::byte> recv(span<std::byte> buf, RecvFlags flags) = 0;
-    virtual span<const std::byte> write(span<const std::byte> data) = 0;
-    virtual span<const std::byte> send(span<const std::byte> data,
-                                       SendFlags flags) = 0;
+    virtual std::span<std::byte> read(std::span<std::byte> buf) = 0;
+    virtual std::span<std::byte> recv(std::span<std::byte> buf,
+                                      RecvFlags flags) = 0;
+    virtual std::span<const std::byte>
+        write(std::span<const std::byte> data) = 0;
+    virtual std::span<const std::byte> send(std::span<const std::byte> data,
+                                            SendFlags flags) = 0;
     virtual size_t lseek(off_t offset, Whence whence) = 0;
     virtual void truncate(off_t size) = 0;
-    virtual void bind(span<const std::byte> sockaddr) = 0;
+    virtual void bind(std::span<const std::byte> sockaddr) = 0;
     virtual void listen(int backlog) = 0;
-    virtual std::tuple<std::optional<int>, span<std::byte>>
-        accept(span<std::byte> sockaddr) = 0;
+    virtual std::tuple<std::optional<int>, std::span<std::byte>>
+        accept(std::span<std::byte> sockaddr) = 0;
     virtual void setsockopt(SockLevel level, SockOpt optname,
-                            span<const std::byte> opt) = 0;
+                            std::span<const std::byte> opt) = 0;
     virtual int ioctl(unsigned long id, void* data) = 0;
     virtual int constIoctl(unsigned long id, void* data) const = 0;
     virtual void fcntlSetfd(FdFlags flags) = 0;
diff --git a/src/stdplus/fd/ops.cpp b/src/stdplus/fd/ops.cpp
index d96dbb5..d47dbb3 100644
--- a/src/stdplus/fd/ops.cpp
+++ b/src/stdplus/fd/ops.cpp
@@ -11,7 +11,7 @@
 {
 
 template <typename Fun, typename Byte, typename... Args>
-static void opExact(const char* name, Fun&& fun, Fd& fd, span<Byte> data,
+static void opExact(const char* name, Fun&& fun, Fd& fd, std::span<Byte> data,
                     Args&&... args)
 {
     while (data.size() > 0)
@@ -26,31 +26,32 @@
     }
 }
 
-void readExact(Fd& fd, span<std::byte> data)
+void readExact(Fd& fd, std::span<std::byte> data)
 {
     opExact("readExact", &Fd::read, fd, data);
 }
 
-void recvExact(Fd& fd, span<std::byte> data, RecvFlags flags)
+void recvExact(Fd& fd, std::span<std::byte> data, RecvFlags flags)
 {
     opExact("recvExact", &Fd::recv, fd, data, flags);
 }
 
-void writeExact(Fd& fd, span<const std::byte> data)
+void writeExact(Fd& fd, std::span<const std::byte> data)
 {
     opExact("writeExact", &Fd::write, fd, data);
 }
 
-void sendExact(Fd& fd, span<const std::byte> data, SendFlags flags)
+void sendExact(Fd& fd, std::span<const std::byte> data, SendFlags flags)
 {
     opExact("sendExact", &Fd::send, fd, data, flags);
 }
 
 template <typename Fun, typename Byte, typename... Args>
-static span<Byte> opAligned(const char* name, Fun&& fun, Fd& fd, size_t align,
-                            span<Byte> data, Args&&... args)
+static std::span<Byte> opAligned(const char* name, Fun&& fun, Fd& fd,
+                                 size_t align, std::span<Byte> data,
+                                 Args&&... args)
 {
-    span<Byte> ret;
+    std::span<Byte> ret;
     do
     {
         auto r =
@@ -65,25 +66,26 @@
     return ret;
 }
 
-span<std::byte> readAligned(Fd& fd, size_t align, span<std::byte> buf)
+std::span<std::byte> readAligned(Fd& fd, size_t align, std::span<std::byte> buf)
 {
     return opAligned("readAligned", &Fd::read, fd, align, buf);
 }
 
-span<std::byte> recvAligned(Fd& fd, size_t align, span<std::byte> buf,
-                            RecvFlags flags)
+std::span<std::byte> recvAligned(Fd& fd, size_t align, std::span<std::byte> buf,
+                                 RecvFlags flags)
 {
     return opAligned("recvAligned", &Fd::recv, fd, align, buf, flags);
 }
 
-span<const std::byte> writeAligned(Fd& fd, size_t align,
-                                   span<const std::byte> data)
+std::span<const std::byte> writeAligned(Fd& fd, size_t align,
+                                        std::span<const std::byte> data)
 {
     return opAligned("writeAligned", &Fd::write, fd, align, data);
 }
 
-span<const std::byte> sendAligned(Fd& fd, size_t align,
-                                  span<const std::byte> data, SendFlags flags)
+std::span<const std::byte> sendAligned(Fd& fd, size_t align,
+                                       std::span<const std::byte> data,
+                                       SendFlags flags)
 {
     return opAligned("sendAligned", &Fd::send, fd, align, data, flags);
 }
diff --git a/src/stdplus/fd/ops.hpp b/src/stdplus/fd/ops.hpp
index 4bfc5ba..8f3735b 100644
--- a/src/stdplus/fd/ops.hpp
+++ b/src/stdplus/fd/ops.hpp
@@ -1,9 +1,9 @@
 #pragma once
+#include <span>
 #include <stdexcept>
 #include <stdplus/fd/dupable.hpp>
 #include <stdplus/fd/intf.hpp>
 #include <stdplus/raw.hpp>
-#include <stdplus/types.hpp>
 #include <utility>
 
 namespace stdplus
@@ -13,18 +13,20 @@
 namespace detail
 {
 
-void readExact(Fd& fd, span<std::byte> data);
-void recvExact(Fd& fd, span<std::byte> data, RecvFlags flags);
-void writeExact(Fd& fd, span<const std::byte> data);
-void sendExact(Fd& fd, span<const std::byte> data, SendFlags flags);
+void readExact(Fd& fd, std::span<std::byte> data);
+void recvExact(Fd& fd, std::span<std::byte> data, RecvFlags flags);
+void writeExact(Fd& fd, std::span<const std::byte> data);
+void sendExact(Fd& fd, std::span<const std::byte> data, SendFlags flags);
 
-span<std::byte> readAligned(Fd& fd, size_t align, span<std::byte> buf);
-span<std::byte> recvAligned(Fd& fd, size_t align, span<std::byte> buf,
-                            RecvFlags flags);
-span<const std::byte> writeAligned(Fd& fd, size_t align,
-                                   span<const std::byte> data);
-span<const std::byte> sendAligned(Fd& fd, size_t align,
-                                  span<const std::byte> data, SendFlags flags);
+std::span<std::byte> readAligned(Fd& fd, size_t align,
+                                 std::span<std::byte> buf);
+std::span<std::byte> recvAligned(Fd& fd, size_t align, std::span<std::byte> buf,
+                                 RecvFlags flags);
+std::span<const std::byte> writeAligned(Fd& fd, size_t align,
+                                        std::span<const std::byte> data);
+std::span<const std::byte> sendAligned(Fd& fd, size_t align,
+                                       std::span<const std::byte> data,
+                                       SendFlags flags);
 
 template <typename Fun, typename Container, typename... Args>
 auto alignedOp(Fun&& fun, Fd& fd, Container&& c, Args&&... args)
@@ -32,7 +34,7 @@
     using Data = raw::detail::dataType<Container>;
     auto ret = fun(fd, sizeof(Data), raw::asSpan<std::byte>(c),
                    std::forward<Args>(args)...);
-    return span<Data>(std::begin(c), ret.size() / sizeof(Data));
+    return std::span<Data>(std::begin(c), ret.size() / sizeof(Data));
 }
 
 } // namespace detail
@@ -127,7 +129,7 @@
 
 inline std::optional<stdplus::DupableFd> accept(Fd& fd)
 {
-    auto ret = std::get<0>(fd.accept(span<std::byte>{}));
+    auto ret = std::get<0>(fd.accept(std::span<std::byte>{}));
     if (!ret)
     {
         return std::nullopt;
diff --git a/src/stdplus/io_uring.hpp b/src/stdplus/io_uring.hpp
index 5e9e778..6572e04 100644
--- a/src/stdplus/io_uring.hpp
+++ b/src/stdplus/io_uring.hpp
@@ -74,7 +74,7 @@
 
     /** @brief Get current list of files descriptors registered on the ring.
      * Note this view potentially expires when registrations change. */
-    inline stdplus::span<const int> getFiles() const noexcept
+    inline std::span<const int> getFiles() const noexcept
     {
         return files;
     }
diff --git a/src/stdplus/raw.hpp b/src/stdplus/raw.hpp
index fd24000..7da4b92 100644
--- a/src/stdplus/raw.hpp
+++ b/src/stdplus/raw.hpp
@@ -1,7 +1,7 @@
 #pragma once
 #include <fmt/format.h>
+#include <span>
 #include <stdexcept>
-#include <stdplus/types.hpp>
 #include <string_view>
 #include <type_traits>
 
@@ -117,17 +117,15 @@
     data.remove_prefix(sizeof(T) / sizeof(CharT));
     return ret;
 }
-#ifdef STDPLUS_SPAN_TYPE
 template <typename T, typename IntT,
           typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>>
-T extract(span<IntT>& data)
+T extract(std::span<IntT>& data)
 {
     T ret = copyFrom<T>(data);
     static_assert(sizeof(T) % sizeof(IntT) == 0);
     data = data.subspan(sizeof(T) / sizeof(IntT));
     return ret;
 }
-#endif
 
 /** @brief Extracts data from a buffer as a reference if aligned
  *         Updates the data buffer to show that data was removed
@@ -143,20 +141,18 @@
     data.remove_prefix(sizeof(T) / sizeof(CharT));
     return ret;
 }
-#ifdef STDPLUS_SPAN_TYPE
 template <typename T, typename IntT,
           typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>,
           typename Tp = detail::copyConst<T, IntT>>
-Tp& extractRef(span<IntT>& data)
+Tp& extractRef(std::span<IntT>& data)
 {
     Tp& ret = refFrom<Tp>(data);
     static_assert(sizeof(Tp) % sizeof(IntT) == 0);
     data = data.subspan(sizeof(Tp) / sizeof(IntT));
     return ret;
 }
-#endif
 
-/** @brief Returns the span referencing the data of the raw trivial type
+/** @brief Returns the std::span referencing the data of the raw trivial type
  *         or of trivial types in a contiguous container.
  *
  *  @param[in] t - The trivial raw data
@@ -181,12 +177,11 @@
             std::size(c) * sizeof(*std::data(c)) / sizeof(CharT)};
 }
 
-#ifdef STDPLUS_SPAN_TYPE
 template <typename IntT, typename T,
           typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>,
           typename = std::enable_if_t<!detail::hasData<T>>,
           typename IntTp = detail::copyConst<IntT, T>>
-span<IntTp> asSpan(T& t) noexcept
+std::span<IntTp> asSpan(T& t) noexcept
 {
     static_assert(std::is_trivially_copyable_v<T>);
     static_assert(sizeof(T) % sizeof(IntTp) == 0);
@@ -196,14 +191,13 @@
           typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>,
           typename = std::enable_if_t<detail::hasData<Container>>,
           typename IntTp = detail::copyConst<IntT, detail::dataType<Container>>>
-span<IntTp> asSpan(Container&& c) noexcept
+std::span<IntTp> asSpan(Container&& c) noexcept
 {
     static_assert(detail::trivialContainer<Container>);
     static_assert(sizeof(*std::data(c)) % sizeof(IntTp) == 0);
     return {reinterpret_cast<IntTp*>(std::data(c)),
             std::size(c) * sizeof(*std::data(c)) / sizeof(IntTp)};
 }
-#endif
 
 } // namespace raw
 } // namespace stdplus
diff --git a/src/stdplus/types.hpp b/src/stdplus/types.hpp
deleted file mode 100644
index 55d9735..0000000
--- a/src/stdplus/types.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-#if __has_include(<nonstd/span.hpp>)
-#define span_CONFIG_SELECT_SPAN span_SPAN_NONSTD
-#include <nonstd/span.hpp>
-#define STDPLUS_SPAN_TYPE nonstd::span
-#endif
-
-namespace stdplus
-{
-
-#ifdef STDPLUS_SPAN_TYPE
-template <typename... Args>
-using span = STDPLUS_SPAN_TYPE<Args...>;
-#endif
-
-} // namespace stdplus
diff --git a/subprojects/span-lite.wrap b/subprojects/span-lite.wrap
deleted file mode 100644
index ee0f0db..0000000
--- a/subprojects/span-lite.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/martinmoene/span-lite
-revision = HEAD
diff --git a/test/raw.cpp b/test/raw.cpp
index a5d4b00..7da5acb 100644
--- a/test/raw.cpp
+++ b/test/raw.cpp
@@ -164,7 +164,7 @@
 TEST_CASE("Span Extract TooSmall", "[Extract]")
 {
     const std::vector<char> v = {'c'};
-    span<const char> s = v;
+    std::span<const char> s = v;
     CHECK_THROWS_AS(extract<int>(s), std::runtime_error);
     CHECK(1 == s.size());
 }
@@ -172,7 +172,7 @@
 TEST_CASE("Span Extract Basic", "[Extract]")
 {
     const std::vector<int> v = {4};
-    span<const int> s = v;
+    std::span<const int> s = v;
     CHECK(v[0] == extract<int>(s));
     CHECK(s.empty());
 }
@@ -180,7 +180,7 @@
 TEST_CASE("Span Extract Larger", "[Extract]")
 {
     const std::vector<int> v{3, 4, 5};
-    span<const int> s = v;
+    std::span<const int> s = v;
     CHECK(v[0] == extract<int>(s));
     CHECK(v.size() - 1 == s.size());
 }
@@ -188,7 +188,7 @@
 TEST_CASE("Span Extract Ref TooSmall", "[ExtractRef]")
 {
     const std::vector<char> v = {'c'};
-    span<const char> s = v;
+    std::span<const char> s = v;
     CHECK_THROWS_AS(extractRef<Int>(s), std::runtime_error);
     CHECK(1 == s.size());
 }
@@ -196,7 +196,7 @@
 TEST_CASE("Span Extract Ref Basic", "[ExtractRef]")
 {
     const std::vector<Int> v = {{4, 0, 0, 4}};
-    span<const Int> s = v;
+    std::span<const Int> s = v;
     CHECK(v[0] == extractRef<Int>(s));
     CHECK(s.empty());
 }
@@ -204,7 +204,7 @@
 TEST_CASE("Span Extract Ref Larger", "[ExtractRef]")
 {
     const std::vector<Int> v{{3}, {4}, {5}};
-    span<const Int> s = v;
+    std::span<const Int> s = v;
     CHECK(v[0] == extractRef<Int>(s));
     CHECK(v.size() - 1 == s.size());
 }
@@ -262,12 +262,12 @@
 TEST_CASE("As Span Span", "[AsSpan]")
 {
     std::array<char, 2> arr = {'a', 'b'};
-    auto sp1 = span<const char>(arr);
+    auto sp1 = std::span<const char>(arr);
     auto s1 = asSpan<uint8_t>(sp1);
     REQUIRE(s1.size() == 2);
     CHECK(s1[0] == arr[0]);
     CHECK(s1[1] == arr[1]);
-    auto sp2 = span<char>(arr);
+    auto sp2 = std::span<char>(arr);
     auto s2 = asSpan<uint8_t>(sp2);
     REQUIRE(s2.size() == 2);
     CHECK(s2[0] == arr[0]);