raw: Span doesn't need to only hold integral types
Change-Id: I8c63806555ef2e3d88f169a729382a6d9f91a31a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/stdplus/raw.hpp b/src/stdplus/raw.hpp
index 638a813..aaf803e 100644
--- a/src/stdplus/raw.hpp
+++ b/src/stdplus/raw.hpp
@@ -85,7 +85,7 @@
}
#ifdef STDPLUS_SPAN_TYPE
template <typename T, typename IntT,
- typename = std::enable_if_t<std::is_integral_v<IntT>>>
+ typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>>
T extract(span<IntT>& data)
{
T ret = copyFrom<T>(data);
@@ -120,7 +120,7 @@
}
#ifdef STDPLUS_SPAN_TYPE
template <typename IntT, typename T,
- typename = std::enable_if_t<std::is_integral_v<IntT>>,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>,
typename = std::enable_if_t<std::is_trivially_copyable_v<T>>,
typename IntTp = detail::copyConst<IntT, T>>
span<IntTp> asSpan(T& t) noexcept
@@ -129,7 +129,7 @@
return {reinterpret_cast<IntTp*>(&t), sizeof(T) / sizeof(IntTp)};
}
template <typename IntT, typename Container,
- typename = std::enable_if_t<std::is_integral_v<IntT>>,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<IntT>>,
typename = std::enable_if_t<!std::is_trivially_copyable_v<Container>>,
typename = decltype(std::data(std::declval<Container>())),
typename IntTp = detail::copyConst<IntT, detail::dataType<Container>>>