From 11968f674a7de34fb7de744598a8086330cd88a3 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Fri, 25 Oct 2024 01:09:10 -0500 Subject: Get working string formatting for unsigned numbers. --- 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 2ced639..718b3d7 100644 --- a/include/fud_string_view.hpp +++ b/include/fud_string_view.hpp @@ -45,6 +45,12 @@ struct StringView { { } + template + StringView(const char (&input)[N]) : m_length{N - 1}, m_data{reinterpret_cast(input)} + { + static_assert(N > 0); + } + StringView(size_t strLen, const char* strData) : m_length(strLen), // line break m_data{reinterpret_cast(strData)} // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) -- cgit v1.2.3