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]);
