summaryrefslogtreecommitdiff
path: root/deimos/core/base.h
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-13 00:04:42 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-13 00:04:48 +0200
commit00143afc01dbca797471181105738042e89f15ae (patch)
treed2b3fa92ed5d17ae5a145758bed637f996cbd501 /deimos/core/base.h
parent8db26a7350aad53ed73a127f9b8eb6ef15bf0be1 (diff)
Use string view everywhere
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r--deimos/core/base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/deimos/core/base.h b/deimos/core/base.h
index 1022ae8..1e9b4a9 100644
--- a/deimos/core/base.h
+++ b/deimos/core/base.h
@@ -128,6 +128,11 @@ public:
constexpr int64_t size() const { return m_size; }
};
+inline Span<const std::byte> AsBytes(StringView span)
+{
+ return { reinterpret_cast<const std::byte*>(span.data()), span.size() };
+}
+
deimos_StaticAssert(std::is_trivially_destructible_v<StringView>);
deimos_StaticAssert(std::is_trivially_copyable_v<StringView>);