summaryrefslogtreecommitdiff
path: root/include/fud_string_view.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-29 23:16:46 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-29 23:16:46 -0500
commit8dcb1de91e15ff7fc66279cd9cd9ad8a70f624e0 (patch)
treec73840b15a074cf37f59bc3b2eff56cde982d74f /include/fud_string_view.hpp
parent8ce397e8c0a83e49e390de9deb73d588e4931ecf (diff)
u8 string literals
Diffstat (limited to 'include/fud_string_view.hpp')
-rw-r--r--include/fud_string_view.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/fud_string_view.hpp b/include/fud_string_view.hpp
index 972630a..6403c27 100644
--- a/include/fud_string_view.hpp
+++ b/include/fud_string_view.hpp
@@ -30,6 +30,12 @@ namespace fud {
class String;
struct StringView {
+ template <size_t N>
+ consteval StringView(const utf8 (&input)[N]) : m_length{N - 1}, m_data{input}
+ {
+ static_assert(N > 0);
+ }
+
constexpr StringView() noexcept = default;
constexpr StringView(const StringView& rhs) noexcept = default;