summaryrefslogtreecommitdiff
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-string.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/core/slang-string.h b/source/core/slang-string.h
index 3fb184ac7..2312c0439 100644
--- a/source/core/slang-string.h
+++ b/source/core/slang-string.h
@@ -181,6 +181,10 @@ namespace Slang
char const* m_end;
};
+ // A more convenient way to make slices from *string literals*
+ template <size_t SIZE>
+ SLANG_FORCE_INLINE UnownedStringSlice toSlice(const char (&in)[SIZE]) { return UnownedStringSlice(in, SIZE - 1); }
+
// A `StringRepresentation` provides the backing storage for
// all reference-counted string-related types.
class StringRepresentation : public RefObject