Use std::copy() instead of std::memcpy()