diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-13 00:04:42 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-13 00:04:48 +0200 |
commit | 00143afc01dbca797471181105738042e89f15ae (patch) | |
tree | d2b3fa92ed5d17ae5a145758bed637f996cbd501 /deimos/core/base.h | |
parent | 8db26a7350aad53ed73a127f9b8eb6ef15bf0be1 (diff) |
Use string view everywhere
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r-- | deimos/core/base.h | 5 |
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>);
|