Copying with memcpy/std::copy is a lot faster than writing one byte at a time. And the behavior should be fully equivalent.