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); }