As Casey Carter (@CaseyCarter) indicated over in #425 (comment) we could engage the memcpy and memset optimization for in more cases, when we can determine that the effective static_cast to unsigned char inside memset is equivalent to what happens during each assignment.
For example, copy / fill bools over chars.
See also a similar case reported on Reddit at reported on https://www.reddit.com/r/cpp/comments/erialk/the_hunt_for_the_fastest_zero/ where we should be able to use memset for any scalar input to allow the optimization to engage for fill(char*, char*, 0).
As Casey Carter (@CaseyCarter) indicated over in #425 (comment) we could engage the memcpy and memset optimization for in more cases, when we can determine that the effective static_cast to unsigned char inside memset is equivalent to what happens during each assignment.
For example, copy / fill bools over chars.
See also a similar case reported on Reddit at reported on https://www.reddit.com/r/cpp/comments/erialk/the_hunt_for_the_fastest_zero/ where we should be able to use memset for any scalar input to allow the optimization to engage for
fill(char*, char*, 0).