diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 16:08:55 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 16:08:55 +0200 |
commit | 24bb0db16d2fcd94a5919f616dd9a50b3a131752 (patch) | |
tree | 80850a5bb79d334cc66ab2427daea238d51df1ea /deimos/core/base.h | |
parent | f878f9e4c42f02585e57bb35c3aabf9f69ee3834 (diff) |
Add io Writer
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r-- | deimos/core/base.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/deimos/core/base.h b/deimos/core/base.h index c3b0d87..8295053 100644 --- a/deimos/core/base.h +++ b/deimos/core/base.h @@ -85,5 +85,12 @@ public: constexpr int64_t size() const { return m_size; }
};
+template<typename T>
+inline Span<const std::byte> AsBytes(Span<T> span)
+{
+ // NOLINTNEXTLINE
+ return { reinterpret_cast<const std::byte*>(span.data()), span.size() * (int64_t)sizeof(T) };
+}
+
} // namespace deimos
|