From 24bb0db16d2fcd94a5919f616dd9a50b3a131752 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic <steven.lerouzic@gmail.com> Date: Thu, 4 Apr 2024 16:08:55 +0200 Subject: Add io Writer --- deimos/core/base.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'deimos/core/base.h') 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 -- cgit