Fix ConstexprString::ConstexprString(std::string_view)

This commit is contained in:
sha512sum 2024-10-30 16:27:26 +00:00
parent 6fa97fcb87
commit 555d9f9645

View file

@ -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<char, Size> data) : data(std::move(data)) {};
constexpr auto size() const {