Fix constexpr_string.hpp: include and std::copy_n -> std::ranges::copy_n

This commit is contained in:
sha512sum 2024-03-04 17:45:07 +00:00
parent ed9f47d081
commit 616819edbe

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <fmt/core.h> #include <fmt/format.h>
namespace utempl { namespace utempl {
template <std::size_t> template <std::size_t>
@ -54,8 +54,8 @@ struct ConstexprString {
template <std::size_t SSize> template <std::size_t SSize>
inline constexpr auto operator+(const ConstexprString<SSize>& other) -> ConstexprString<Size + SSize - 1> { inline constexpr auto operator+(const ConstexprString<SSize>& other) -> ConstexprString<Size + SSize - 1> {
ConstexprString<Size + SSize - 1> response; ConstexprString<Size + SSize - 1> response;
std::copy_n(this->begin(), Size - 1, response.begin()); std::ranges::copy_n(this->begin(), Size - 1, response.begin());
std::copy_n(other.begin(), SSize, response.begin() + Size - 1); std::ranges::copy_n(other.begin(), SSize, response.begin() + Size - 1);
return response; return response;
}; };
inline constexpr ConstexprString(const ConstexprString&) = default; inline constexpr ConstexprString(const ConstexprString&) = default;