From a921676b77268d614a4544ba13431d5340a1b5fb Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Tue, 15 Feb 2022 10:29:23 +0100 Subject: [PATCH] Reintroduced previously erroneously removed memcpy --- const_fmt/format_impl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/const_fmt/format_impl.h b/const_fmt/format_impl.h index 425aaa1..2f8e822 100644 --- a/const_fmt/format_impl.h +++ b/const_fmt/format_impl.h @@ -95,6 +95,10 @@ constexpr inline const char* digits2_base(size_t value) { constexpr inline void copy2(char* dst, const char* src) { + if (!std::is_constant_evaluated()) { + std::memcpy(dst, src, 2); + return; + } *dst++ = static_cast(*src++); *dst = static_cast(*src); }