From 555d9f9645e6ba634fb1943cceee6aa731807413 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Wed, 30 Oct 2024 16:27:26 +0000 Subject: [PATCH] Fix ConstexprString::ConstexprString(std::string_view) --- src/constexpr_string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constexpr_string.cpp b/src/constexpr_string.cpp index f736c55..6cd0337 100644 --- a/src/constexpr_string.cpp +++ b/src/constexpr_string.cpp @@ -33,7 +33,7 @@ struct ConstexprString { std::ranges::copy_n(data, Size, this->data.begin()); }; explicit constexpr ConstexprString(std::string_view data) : data{} { - std::ranges::copy_n(data.begin(), Size, this->data.begin()); + std::ranges::copy_n(data.begin(), data.size() > this->size() ? this->size() : data.size(), this->data.begin()); }; explicit constexpr ConstexprString(std::array data) : data(std::move(data)) {}; constexpr auto size() const {