summaryrefslogtreecommitdiff
path: root/test/test-static-stream_support.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-28 13:49:54 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-12-28 13:50:06 +0000
commit69acdf6584be2a04094e27b395c50c071b2b15cf (patch)
treeb9134ccb2087960637c6d7059f51af7fb02c18e3 /test/test-static-stream_support.cpp
parentNo need for the range hack, the shadow box is just centred around the origin (diff)
downloadilt-69acdf6584be2a04094e27b395c50c071b2b15cf.tar.bz2
ilt-69acdf6584be2a04094e27b395c50c071b2b15cf.tar.xz
ilt-69acdf6584be2a04094e27b395c50c071b2b15cf.zip
Use the existence of .substr(...) to test if a T is stringlike
Diffstat (limited to 'test/test-static-stream_support.cpp')
-rw-r--r--test/test-static-stream_support.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-static-stream_support.cpp b/test/test-static-stream_support.cpp
new file mode 100644
index 0000000..367d5a2
--- /dev/null
+++ b/test/test-static-stream_support.cpp
@@ -0,0 +1,11 @@
+#include "stream_support.hpp"
+
+#include <array>
+#include <vector>
+
+static_assert(spanable<std::vector<int>>);
+static_assert(spanable<std::vector<char>>);
+static_assert(spanable<std::array<int, 1>>);
+static_assert(spanable<std::array<char, 1>>);
+static_assert(!spanable<std::string>);
+static_assert(!spanable<std::string_view>);