diff --git a/const_fmt/stdlib.h b/const_fmt/stdlib.h index b963489..1636570 100644 --- a/const_fmt/stdlib.h +++ b/const_fmt/stdlib.h @@ -187,8 +187,10 @@ concept floating_point = is_floating_point_v; template -constexpr inline void copy(input_t* start, input_t* end, output_t* dest_start) { - memcpy(start, dest_start, end - start); +constexpr inline void copy(const input_t* start, const input_t* end, output_t* dest_start) { + auto temp = start; + while (temp != end) + *(dest_start++) = *(temp++); }