From 8dcb1de91e15ff7fc66279cd9cd9ad8a70f624e0 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Tue, 29 Oct 2024 23:16:46 -0500 Subject: u8 string literals --- include/fud_string_view.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/fud_string_view.hpp') 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 + 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; -- cgit v1.2.3