memcpy to std::copy