summaryrefslogtreecommitdiff
path: root/include/fud_string_view.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/fud_string_view.hpp')
-rw-r--r--include/fud_string_view.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/fud_string_view.hpp b/include/fud_string_view.hpp
index 718b3d7..972630a 100644
--- a/include/fud_string_view.hpp
+++ b/include/fud_string_view.hpp
@@ -61,6 +61,13 @@ struct StringView {
explicit StringView(const String& fudString) noexcept;
+ template <size_t N>
+ constexpr static StringView cStringView(const char (&input)[N])
+ {
+ static_assert(N > 0);
+ return StringView{N, reinterpret_cast<const utf8*>(input)};
+ }
+
[[nodiscard]] constexpr size_t length() const
{
return m_length;